devbridge / BetterCMS.Demo

Other
9 stars 8 forks source link

how to copy local .mdf file to my remote server #22

Open stpriyanka opened 9 years ago

stpriyanka commented 9 years ago

Hi I started working on a project from scratch using bettercms a month ago. now I have my own remote server in azure where i want to deploy my project . But how can i copy the local .mdf file to remote server ? all my bettercms files are stored in local .mdf file. I tried to back up with sql script but i got an error like Index was out of bound array.

Adomavicius commented 9 years ago

Unfortunately, if you are using a local .mdf file you will not be able to simply upload it to Azure, as is outlined in this discussion: http://forums.asp.net/t/1957553.aspx?steps+to+go+from+local+mdf+to+azure+sql+db .

You will have to deploy the database to Azure SQL or some other Azure supported alternative. The method I found to do the former is this:

  1. Attach your local .mdf file in SQL Server Management Studio. (source: https://learningsqlserver.wordpress.com/2011/02/13/how-can-i-open-mdf-and-ldf-files-in-sql-server-attach-tutorial-troublshooting/);
  2. Once you have the database attached, you can deploy the database to SQL Azure (source: http://stackoverflow.com/a/20815564);
  3. Change your connection string to fit the SQL Azure credentials.
sherry098 commented 5 years ago

Hi,

In order to copy the local .mdf file to Azure you can use the reliable application named as SysTools SQL to Azure Migration Software. The utility just requires the .mdf files for carrying out the migration process.

To migrate or copy .mdf files to Azure follow these simple steps:

https://www.systoolsgroup.com/sql-server/azure/

1- Launch and run SQL Server to Azure DB Migrator Tool 2- Choose Scan Option and Auto Detect MDF file version 3- Preview database objects like tables, triggers, views, etc before the migration process 4- Now, migrate SQL Server database to Azure SQL database

To know the process in detail don't forget to read this article :

https://sqltechtips.blogspot.com/2019/06/upload-sql-database-to-azure-sql-server.html