Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 0 down vote accepted

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.)

share|improve this answer
  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. :)

share|improve this answer
    
Would you not restore the database before changing the DNS? –  Dave Jul 24 '12 at 12:02

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

Done!

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

share|improve this answer
    
As this is a .net website then it's not on Unix. Also, can you provide more information on how to dump an mssql database? –  paulmorriss Jul 24 '12 at 8:41
1  
Not necessarily you have to do operations on files on the server (therefore you could still use UNIX). This link is to a question on SO that would point out a more Windows friendly answer about sed stackoverflow.com/questions/127318/… . As for the MSSQL dump I wouldn't know, after I have typed google.com/search?q=how+to+dump+mssql+database I've found ServerFault answer serverfault.com/questions/147638/… –  milo5b Jul 24 '12 at 8:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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