Benjamin Lu

everyday is cool

Moving a Website to a New Host

A small site can look like a folder of files right up until you have to move it. Once it uses PHP and a database, the files are only part of what needs to travel.

Try a practice move between two local environments. Copy the site files, export the database, and import that export into the second environment. Update the database settings there and open the homepage. Then open an older post, load an image, and try a URL that depends on routing. A working homepage can hide a problem with the uploaded media or server configuration.

Write down every setting you had to change. For an actual move, test the new host before switching public DNS and keep the old copy available during the transition. If the site accepts comments or other writes, plan when to stop writes on the old copy so they don’t get lost between the export and the switch.