Moving a Drupal site to a new host or domain name

If you are moving attached files in your Drupal site to a new domain name, the following SQL query to run on the files table is a lifesaver:

UPDATE `files` SET `filepath` = REPLACE(`filepath`, "sites/old.domain.name/files/", "sites/new.domain.name/files/");

Simply replace 'old.domain.name' and 'new.domain.name' with your respective values and run the query!

Drupal version: 

Add new comment