How to publish/transfer a completed website with database from one server to another server?

I have been creating .net website with mssql database (with an inbuilt online text editor for live editing of the website from my clients), how do I completely transfer the entire website from my server folder.

i.e mywebsite.com/demo/index.aspx to >>> client.com/index.aspx

Any easy way to do it?

3 Answers 3


There are a number of ways to accomplish this, depending on your levels of experience and the features installed on your client's server - without more information (that would probably make this question too localised for this site) I can't walk you through the exact steps.

One option would be to start with something like FTP and configure everything manually. This would give you complete control, and requires minimal additional software on the server:

  1. FTP the files for the site, and either a database backup file or the .MDF/LDF files, (or if using the disk based access the .MDB.
  2. Configure IIS to serve your site:
    1. Create a new Website, with the Home Directory pointing to the location of your site on the disk.
    2. Ensure the App Pool is configured to use the correct version of ASP.NET (2.0 for .NET 2.0 - 3.5 apps, or 4.0 for .NET 4.0 apps).
  3. Deploy your database into SQL Server if needed (either by restoring the backup file to a new database, or attaching the files directly), ensuring you name the new database correctly.
    1. Ensure your logins are correct - if you're using SQL Logins, you'll need to remove these from the database and re-create them on the server, adding them back to the database, if you're using Integrated Auth, ensure that the user the App Pool is running under has the correct rights to your database.
  4. Update the connection strings in your web.config to point to the new Database server.
  5. You should now be able to browse your site.
  6. [...]
  7. Profit!

Alternatively, if your client's server supports it, you could try either the Publish Web Site Tool within Visual Studio or Web Deploy for IIS 7.

Depending on how you've built the site, you may need to perform some additional work on the files to remove explicit paths to /demos/ - typically for managed links you can use ~/ to get you to the root of your application (rather than the root of the server), but these might not work for standard links (img src, link href's, etc.)


I assume you would like to move it from a physical location to another, and not only changing the DNS associated to it. I also assume yoursite and clientsite are not development server and production, but just one-off. Please specify if assumptions are wrong.

You basically need to make sure of few things:

1) Your paths must match ( i.e. if you use /demo/, would need to remove that throughout the site). Easy way to change this is with sed (on UNIX)

2) Your database credentials must match (create an username with same usr and password)

3) dump database and import it in your client's server.

4) move files (with modified path) across


Hope I didn't miss any step and that this helps.

  1. Please make sure you have backup all your files and your database
  2. Please uplaod your files to your new server
  3. Change your DNS to new name server
  4. Then restore your database

Hope this help. :)

  • Would you not restore the database before changing the DNS?
    – Dave
    Commented Jul 24, 2012 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.