meetpd
meetpd

Reputation: 9219

Moving PHP site from one server to another

I have no idea about PHP.

I have PHP site hosted on Server A. Now I want to transfer the hosting to another company having Windows hosting on Server B.

Can I just transfer all the contents of WWWROOT folder of Server A to Server B? Will the site work that way? Or I do have to get the source, compile and publish it?

Thanks!

Upvotes: 1

Views: 9046

Answers (5)

udo
udo

Reputation: 5210

the process is this:

  1. copy the content from server A to B (also db dump)
  2. make sure your site is working on server B correct
  3. set a redirect on server A to server B (usually in .htaccess file)
  4. edit DNS entries to point to server B
  5. wait that DNS changes have been picked up (note: as suggested by Emil you can reduce this time by lowering TTL setting on the DNS entries)
  6. remove content from server A (end hosting)

Upvotes: 1

Till
Till

Reputation: 3154

No need to compile, however you have to make sure that the new server meets all the requirements of your application (e.g. server modules) and that paths are correctly configured. Also under some circumstances the PHP version can matter as well. Only one way to find out!

Upvotes: 1

Craig White
Craig White

Reputation: 14022

PHP scripts are source code and are compiled when needed. Simply moving the files is enough. Problems may occur if it is a package that has been isntalled on that server and may have some properties in various files about absolute paths to other files.

Also, issues will occur if the files are talking to a local SQL server or the such.

Many hosting companies offer a free (or sometimes payed) service to copy your website accross including any databases. Ask your hosting company for help.

Upvotes: 1

deceze
deceze

Reputation: 522636

PHP is not (usually) compiled, you should be able to simply copy the files and directories over and they should at least run. You may have to set up a database and connections to it, change some configuration in the scripts and you may or may not run into incompatibilities between different PHP versions and/or UNIX/Windows problems though, depending on how portable the scripts were written.

Upvotes: 2

heximal
heximal

Reputation: 10517

you don't need to compile anything. it's enough to copy project directory from one server to another. one thing can cause your project not working on ohter hosting, if there will not be installed some php-extensions that are required for you project. and of course, if your project uses some databases, they must be created on new server

Upvotes: 1

Related Questions