1

I am planning to switch web hosting provider for one based in the UK, as the data centers and offices for my current web hosts are in the US which makes it a lengthy process if I need to contact them etc. I am going to transfer my domain name (so I think that all of my URLs will be the same) and I have downloaded my public_html directory and MySQL database to my computer. If I just upload everything to my new host will everything work?

I have checked and I know that my new hosts have similar spec'd servers with PHP 5, but it just seems a little too simple. The biggest thing I am concerned about is the different timezones and the MySQL database really. If it makes any difference, I will be using shared hosting.

2
  • IN my experience it doesn't make much of difference. you can simply copy the files and mysql database and you should be ready. You can try it on a subdomain pointing to the new server and keep the main site on the old server. then if everything looks fine you can switch to the main domain. Jan 20, 2013 at 14:16
  • @MohammedShameem thanks for your comment, hopefully my experience will be the same as yours :)
    – Andy
    Jan 20, 2013 at 17:16

2 Answers 2

1

Drupal sets the timezone setting in PHP, so you should have the same timezone on the new server as you had on the old server. There could be issues when adding new times, but you'll quickly see that and fix it.

Running the same version of Apache, PHP, and MySQL should make things "just work", with caveats being things like htaccess overrides (sometimes you can't use certain overrides in your htaccess file in shared environments), PHP sub-versions of 5 (i.e. 5.2 to 5.4 introduces some new stuff, deprecates some functions, etc., but your code should still run fine), etc.

You should be able to reach your new shared account via some machine-code URL, like http://my-account-number.my-new-host.com to see that everything works before you point the domain. Be sure to clear the cache by visiting admin/config/development/performance after you do the import, OR when you export the database, do not include the contents of the cache_* tables. Backup and Migrate module makes this part easy, as that's the default when you export a database.

4
  • Thank you for your reply. Just to clarify, I have exported all of the tables in my MySQL database that my Drupal 7 installation uses (including the cache_* tables). You're saying that as long as I clear the caches as soon as I reinstate everything on my new host I should be fine? And by the way, my current host uses PHP 5.2.x where as the new one has 5.3.x, and they both allow .htaccess and Perl access
    – Andy
    Jan 20, 2013 at 16:52
  • I would export the cache* tables but not their contents, in other words the actual structure of the tables should be migrated, but you don't need (or want) the rows contained within these tables because Drupal will rebuild them automatically, and some can contain paths or other data that you don't want on the new server. Jan 20, 2013 at 22:46
  • Thank you for that. What's the easiest way for me to do that using phpMyAdmin please?
    – Andy
    Jan 21, 2013 at 7:18
  • When you do an export from phpMyAdmin, you should see all of the tables with checkboxes to export the structure and checkboxes to export the data. You would uncheck the data boxes for the cache tables. Jan 21, 2013 at 16:25
3

Few things to check.

Which version of PHP? I've seen Drupal sites break going from 5.3 to 5.4

You might want to check what the TTL of your domain is. If it's long you'll have people visiting the new site and the old one at the same time. You can set it to 5 minutes (300) which should make sure everbody moves across to the new site at roughly the same time.

Stress testing. Can the new hosting actually handle the expected load? Things like uploading images will take a lot of memory.

2
  • Thank you for your answer too. Regarding the PHP version, I'm currently using PHP 5.2, but the new host supports 5.3. However, I'm not sure what you mean about the TTL as I will be transferring my domain name; so I don't see how users could access my site on the old server too, but I will try to change the TTL on my current hosts anyway. Also, I'm pretty sure the new hosts have servers with similar specifications and will be capable but how do you suggest I accurately determine this?
    – Andy
    Jan 20, 2013 at 17:13
  • TTL is how long the domain is cached for by users. en.wikipedia.org/wiki/Time_to_live#DNS_records Jan 20, 2013 at 20:19

Your Answer

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

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