Skip to main content
  • X Twitter
  • youtube
Home
Drupal 4U
Built for AI. Powered by Drupal.
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact

Breadcrumb

  1. Home
  2. HowTos
  3. How to copy a Drupal site within 10 minutes

How to copy a Drupal site within 10 minutes

HowTos
September 02, 2013
Profile picture for user drupal
By drupal
  • facebook-f
  • twitter
  • envelope
  • print
424

There are many often complex and time consuming ways to copy a Drupal website from one webhosting company to another-one. This howto offers you instructions how to do it the easy way. It is based on the following assumptions: You have the same Drupal versions on both sides and Drupal is already installed at the destination.

Solution
Export of Drupal database using phpMyAdmin

Step 1: Export the database

Open phpMyAdmin and export all the tables of your Drupal installation. Select "Custom - display all possible options" and choose the option "Save output to a file". Verify that all tables are selected and export the database. Save the .sql file.

Modification to avoid sql error message #1044 - Access denied for user

Step 2: Modify the database

Before you import the database, you have to make a small modification to the exported database file. Open the database with a text editor and edit the following section. The 3 instances of xxxxxxxxxxxx represent the database name/user name of the exported database. To avoid access rights problems you have to replace it with the database name/user name of the database at the destination.

--
-- Database: `xxxxxxxxxxxx`
--
CREATE DATABASE IF NOT EXISTS `xxxxxxxxxxxx` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `xxxxxxxxxxxx`;

If you don't do it you most probably get the following error message:

#1044 - Access denied for user 'xxxxxxxxxxxx' to database 'xxxxxxxxxxxx'

phpMyAdmin import of Drupal database

Step 3: Import the database

After the modification you can import the database using phpMyAdmin.

Step 4: Copy the files

Copy all customized elements from your Drupal installation folder at the origin web-server to the same place at the destination web-server. Usually all the customized elements are stored in the folder sites/all. Frequently you might have uploaded files in sites/default. If you have files in other folders, copy them too. Don't copy and overwrite the file sites/default/settings.php. If you do, you will have to modify the password in the following section (username and password you already adjusted by modifying the import file).

$databases = array('default' => array( 'default' => array(
'driver' => 'mysql',
'database' => 'xxxxxxxxx',
'username' => 'xxxxxxxxx',
'password' => 'yyyyyyyyy',
'host' => 'localhost',
'prefix' => '',
'collation' => 'utf8_general_ci',
)));

Status message Drupal database update script

Step 5: Run the update scripts

When you open the website at the destination, you should now encounter an exact replica of your Drupal website.* To complete the process you will be asked to run the "database update script". If you go to Reports - Status Report you will see the message "Some modules have database schema updates to install. You should run the database update script immediately." Run the script and you are done :-)

* A very common cause of a failure is to be found in the prefix of the database. You can modify the prefix in the settings.php in the folder sites/default. The prefix at the destination should be the same as at the origin database. Search for the entry 'prefix' => '',

How to copy a Drupal site within 10 minutes
Installation

Read more articles

Newer
How to automatically sort uploaded images and files in Drupal 7 (Multiupload)
Older
How to display search results as views
  • Log in to post comments
Profile picture for user drupal
drupal
424
1
min read
A- A+
  • facebook-f
  • twitter
  • envelope
  • print

Contact Us

Get in touch for questions and our Drupal development, design and optimization services.

Contact Us

We aim to reply the latest within 48h.

Drupal 4U: Built for AI. Powered by Drupal.

We are a group of Drupal designers, developers and webmasters. We are Drupal experts! We provide comprehensive services that go beyond traditional web development, focusing on how AI understands, interprets, and cites your content. With our deep expertise in Drupal's architecture, we build the intelligent core of your digital presence, ensuring your brand remains authoritative and visible in a world where AI is the primary gatekeeper of information. Partner with us and let's future-proof your digital strategy together.

  • X Twitter
  • youtube

Drupal Services

  • Drupal Web Design
  • Drupal Development
  • Drupal SEO
  • Drupal GEO
  • Drupal Migration

Drupal 4U

  • Services
  • Showcases
  • Themes
  • Blog
  • About

Drupal Links

  • Official Drupal Website
  • Theme Forest
  • Gaivas Themes
  • More Than Themes
  • DXPR: Drupal for Marketers
  • Drupal Answers
2012 - 2025, Drupal 4U

Footer menu

  • Contact
Home
Drupal 4U
Built for AI. Powered by Drupal.
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact
Clear keys input element