asp.net mvs ASPNETDB - 将sql server上传到托管站点

时间:2021-10-26 03:15:53

i have taken the default asp.net mvc template and customized to work for me. I want to now upload this to my hosting provider.

我采用了默认的asp.net mvc模板并定制为我工作。我想现在将此上传到我的托管服务提供商。

how do i get the sql server database into my server. Do i just upload the ASPNETDB.mdf file. What is this file actually? Does it represent the whole database.

如何将sql server数据库导入我的服务器。我只是上传ASPNETDB.mdf文件。这个文件究竟是什么?它代表整个数据库吗?

Can i simply copy that file around to migrate my database.

我可以简单地复制该文件来迁移我的数据库。

2 个解决方案

#1


The MDF file is the data file for your database. You would normally attach the database to the server instance, or take a backup of the database and restore it. However with your hosting provider this may not be possible, and you may need to create all the database objects again (via SQL scripts) and import any data that you require.

MDF文件是数据库的数据文件。您通常会将数据库附加到服务器实例,或者备份数据库并将其还原。但是,对于您的托管服务提供商,这可能无法实现,您可能需要再次创建所有数据库对象(通过SQL脚本)并导入所需的任何数据。

Attaching a database

附加数据库

Restoring a database

恢复数据库

#2


Take a look at the "Database Publishing Wizard" from Microsoft. I hosted my site on GoDaddy and used it to get my database and data across.

看看Microsoft的“数据库发布向导”。我在GoDaddy上托管了我的网站并用它来获取我的数据库和数据。

Of course I never used the default MDF file. I actually created a primary database, imported the MDF file into it and added my own tables. And I used the DBW for that as well.

当然我从未使用过默认的MDF文件。我实际上创建了一个主数据库,将MDF文件导入其中并添加了我自己的表。我也使用了DBW。

You can find the Database Publishing Wizard here.

您可以在此处找到数据库发布向导。

#1


The MDF file is the data file for your database. You would normally attach the database to the server instance, or take a backup of the database and restore it. However with your hosting provider this may not be possible, and you may need to create all the database objects again (via SQL scripts) and import any data that you require.

MDF文件是数据库的数据文件。您通常会将数据库附加到服务器实例,或者备份数据库并将其还原。但是,对于您的托管服务提供商,这可能无法实现,您可能需要再次创建所有数据库对象(通过SQL脚本)并导入所需的任何数据。

Attaching a database

附加数据库

Restoring a database

恢复数据库

#2


Take a look at the "Database Publishing Wizard" from Microsoft. I hosted my site on GoDaddy and used it to get my database and data across.

看看Microsoft的“数据库发布向导”。我在GoDaddy上托管了我的网站并用它来获取我的数据库和数据。

Of course I never used the default MDF file. I actually created a primary database, imported the MDF file into it and added my own tables. And I used the DBW for that as well.

当然我从未使用过默认的MDF文件。我实际上创建了一个主数据库,将MDF文件导入其中并添加了我自己的表。我也使用了DBW。

You can find the Database Publishing Wizard here.

您可以在此处找到数据库发布向导。