Move from Free to Paid Hosting

www.bessieknowsbest.co.uk

Bessie Knows Best Website

Bessie Knows Best (www.bessieknowsbest.co.uk) is a caravan review website for Northern Ireland and up until yesterday it had been hosted at no cost by 000webhost.

I have hosted a few personal websites on 000webhost in the past, and while it is great to avail of free hosting, I decided to move Bessie to paid for hosting for a number of reasons:

  • Reliability was noticeably worse than my paid hosting. For example, quite often my email client failed to retrieve email when it was asked.
  • Certain functionality in the CPanel, for example, backing up the website failed regularly.
  • It was not possible to update my WordPress Blog to the latest version of WordPress automatically as there is a 2MB upload_max_filesize limit imposed by 000webhost. This meant i had to do it manually.

It is very easy to move a WordPress Blog from one host to another where the domain name will not be changing.

  • Copy all files from the old host to the new host.
  • Backup the database from the old host
  • Create a new database on the new host. Create a database user and give that user the appropriate privileges for the database.
  • Import the database to the new host.
  • Modify the ‘DB_NAME’, ‘DB_USER’, ‘DB_PASSWORD’ and ‘DB_HOST’ in the wp-config.php to reflect the new host’s database.

Import a Drupal Website from a Server and run it locally on an Acquia Drupal AMP Stack

It is possible that you have created and edited a Drupal website on a server and now find that you want to work on this Drupal installation locally instead to speed up development time. To do this you need to import the Core Drupal website to your local Acquia Drupal AMP stack and make some local modifications. Here are the step by step instructions:

  1. FTP the entire Drupal folder from the server down to a local directory on your computer.
  2. Export the Drupal database from the server to your local computer.
  3. On the Acquia Dev Desktop Control Panel, select the ‘Localhost’ dropdown menu and choose ‘more’.
  4. Click the ‘Import’ button and fill in the details as in the following screenshot.
    • Set the ‘site path’ folder to the location where the source code resides (see Step 1.)
    • Select the ‘I have a MySql database dump file for my site’ radio button and give the database a new name.
    • Choose a local server name to run your core Drupal installation from. Note that it is not possible to use ‘localhost’.
    Web-Design-Import-Site

    Import Site Settings


  5. After clicking the ‘Import’ button, the code and database are imported to the local Acquia Drupal AMP Stack.
  6. If you have multiple setting.php files (i.e. one under the ‘sites/default’ folder and one under the ‘sites/’ folder), to aid troubleshooting you can remove one of these. In this case, I have removed the settings.php under the ‘sites/’ folder.Web-Design-One-Settings[/caption]

  7. The Core Drupal settings.php file you have imported may be structured differently to the Acquia AMP settings.php. You can standardise it by making a couple of modifications:
    • Remove the contents of $databases = array ();
    • Web-Design-Settings-Mod1

      Remove Contents of $databases Array



    • Remove the salt string also.
    • Web-Design-Settings-Mod2

      Remove Contents of Salt String


  8. Add the following code and note that when you try to run the website locally an error occurs:
  9. Web-Design-Settings-Mod3

    Error


  10. A closer investigation of the imported database reveals the problem. The database table prefix ‘dr_’ has been imported to the local database from the server and the Acquia Drupal AMP stack was not expecting this.
  11. Web-Design-Settings-Mod4

    Database


  12. To remedy the problem, add the table prefix ‘dr_’ to the settings.php. Once this has been added the imported website runs locally.
  13. Web-Design-Settings-Mod5

    Table Prefix


  14. The bottom of the settings.php should now look like the right hand side of the following snapshot:
  15. Web-Design-Settings-Mod6

    Bottom of settings.php File

Related Posts:

Modify local Drupal site on Acquia AMP stack for upload to Server

Assuming you have already installed Core Drupal on your Acquia AMP stack then you can upload your website to the web server after making the following modifications:

  1. Modify the settings file to reflect the new server name and database:
    • Change the “base_url” to reflect the url (domain name and path) of the Drupal installation on the server.
    • Change the “db_url” to reflect the database user on the server. You will also need to modify the host from “127.0.0.1” to “localhost”.
    • Change the “username” to reflect the database user on the server.
    • Change the “password” to reflect the database password on the server.
    • Change the “host” from “127.0.0.1” to “localhost”.
    Web Design Northern Ireland Settings

    settings.php

  2. Drupal can have multiple setting.php files: one for each Drupal installation and also a default settings.php.
  3. Web Design Northern Ireland Edit and Copy

    Edit settings.php and copy to Default Folder


  4. If you only have one Drupal installation on your target server then you can just keep the default settings.php file and delete the project specific settings.php. This can make troubleshooting any issues more straightforward as you can be certain that Drupal is using the settings.php file that you are expecting it to use.
Web Design Northern Ireland Default Settings

Default settings.php

Related Posts:

If you need a web designer in Northern Ireland please contact us at Abipo Web Design Northern Ireland.