Moving Drupal site to a new webhotel

I need to move a Drupal site to a new webhotel. This is a small StepByStep guide.

My related Drupal blog posts

In new hotel

In country top-level-domain handler (https://www.dk-hostmaster.dk for DK)

  • If you do not get reply you should find mail from the country top-level-domain handler
    • Retrieve login info from the mail. For DK it could look like this: ABC123-DK
    • Login to top-level-domain handler
      • If this is a new domain then activate your domain
      • If this is an existing domain then change DNS servers (redelegate) – do this as last step
        • Find mail from your new webhotel and find the nameservers
        • Enter the new nameservers

In old hotel

  • Backup Drupal files
    • Open FileManager
      • Compress /public_html/yoursite/ to /mybak/yoursite.tar.gz
      • Download to C:\mybak\yoursite.tar.gz
  • Backup Drupal DB
    • Open phpMyAdmin
      • DB: mydrupaldb
      • Export
      • Method: Custom
      • Output: Gzipped
      • Go
      • Save as C:\mybak\mydrupaldb.sql.gz

In new hotel

  •  Upload files
    • Open FileManager
      • Upload file C:\mybak\yoursite.tar.gz to /mybak/yoursite.tar.gz
      • Upload file C:\mybak\mydrupaldb.sql.gz to /mybak/mydrupaldb.sql.gz
  • Create DB
    • Open MySQL Database Wizard
      • Created DB: site_sub_dp7_prddb
      • Created DB user: ‘mydpdbo’ psw ‘xxxxxx’
      • Give: All privileges
    • Open phpMyAdmin
      • DB: site_sub_dp7_prddb
      • Import – Choose file: mydrupaldb.sql.gz
      • Go
  • Add your domain – if your domain is not the primary domain
    • Open “Addon domains”
      • Domain: yourdomain.xx
      • Root: yourdomain.xx
      • New FTP user: yourdomainadm
      • Psw: xxxx
      • OK
      • Verify folder /yourdomain.xx/ has been created
  • Extract site
    • Open FileManager
      • Extract /mybak/yoursite.tar.gz to /mybak/tmp
      • Select all files in subfolder /mybak/tmp/yourdomain.xx and copy to /yourdomain.xx
      • Change perms to write on /yourdomain.xx/sites/default/
      • Change perms to write on /yourdomain.xx/sites/default/themes/
      • Change perms to write on /yourdomain.xx/sites/default/settings.php
    • Edit public_html/sites/default/settings.php
      • ‘database’ => ‘site_sub_dp7_prddb’,
      • ‘username’ => ‘mydpdbo’,
      • ‘password’ => ‘xxxx’,
      • ‘host’ => ‘yourwebhoteldbserver.xx’,
      • ‘port’ => ”, //Need any port number or leave empty?
      • Save and close file
      • Remove write perms on /yourdomain.xx/sites/default/settings.php
      • Remove write perms on /yourdomain.xx/sites/default/
      • Remove write perms on /yourdomain.xx/sites/default/themes/
      • delete /mybak/tmp/

Test when redelegation has happened

  • In your old hotel open phpMyAdmin – goto table menu_custom – notice number of menus
  • In your new hotel open phpMyAdmin – goto table menu_custom – notice number of menus
  • On your site
    • Goto http://yourdomain.xx/admin/structure/menu/add
    • Enter a new menu
  • Goto phpMyAdmin on each hotel and verify where the menu was added
  • On your site
    • Delete the menu
    • Repeat 60 min later if the row was not added to your new hotel
  • If error “Lost connection to MySQL” did you specify DB correct?

The End

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: