This type of question appears several times over the years, when someone has wanted to create a near copy of one site onto a new site by using the first site as a type of template, but I couldn't find an answer that I could understand.

If I had a Drupal site, modules, and a couple of hundred pages about the colour 'RED', and I wanted to create an identical site with similar pages, but about the colour 'BLACK', would the following work?

Using cPanel of the 'RED' site, use the Backup Wizard to back up the Drupal MySQL Database to my desktop.

Install Drupal and modules, and a MySQL Database on the new 'BLACK' site using the same user1 and password.

Replace the 'sites' file on the 'BLACK' site with the 'sites' file from the 'RED' site.

Using cPanel on the 'BLACK' site, use the Backup Wizard to restore the Drupal MySQL Database from my desktop to the 'BLACK' site.

Using 'search' on the 'Black' site, find every page containing the word 'RED' and change it to 'BLUE'.

I guess what I'm asking is. To create a near identical site, is it 'simply' a matter of copying the mySQL Database and 'sites' file.

I'm cuirrently using Drupal 6.x

Would the above work, or is it far harder than that?

Comments

prodosh’s picture

You are on the right track. All Drupal data, except for files (for example pictures) are stored in the database. The programs are usually stored in sites/all/modules and sites/all/themes and files are usually in sites/default/files. By moving the sites directory to the new site and restoring the database you are almost 70% of the way there.

One thing to remember is, clear the cache before making the database backup.

In addition, you should do the following on the new "BLACK" site:

- In settings.php, set:
$base_url = 'http://www.example.com';
replacing example.com with your domain

- In settings.php, adjust the line containing
$db_url = 'mysqli://username:password@localhost/databasename';
to reflect your server, database, username, password

- In settings.php, if the line containing $cookie_domain = 'example.com'; is uncommented, replace example.com with your domain. If it is still commented out, don't worry about it.

Now you are left with replacing RED with BLACK in the content. If it is as simple as replacing a few words or a phrase, you could search and replace in the MySQL database.

In Admin -> Settings -> Site Information, change the relevant information.

You need to set up a cron job for your new black site in your hoster's control panel.

Finally, clear the cache on BLACK to make the changes immediately visible.

_______
Anolim: multimedia, community and collaboration solutions

_______
Safe Swiss Cloud: Enterprise grade cloud infrastructure for Drupal B2B solutions and platforms.

David Ipswich’s picture

That's great.

Just the advice I needed to give me the confidence to try this.

Thank you.

breauxlg’s picture

I am getting these messages:

* The block Recent comments was assigned to the invalid region left and has been disabled.
* The block Development was assigned to the invalid region right and has been disabled.
* The block Primary links was assigned to the invalid region header and has been disabled.
* The block Secondary links was assigned to the invalid region left and has been disabled.
* The block Syndicate was assigned to the invalid region right and has been disabled.
* The block Search form was assigned to the invalid region header and has been disabled.
* The block Powered by Drupal was assigned to the invalid region footer and has been disabled.
* The block User login was assigned to the invalid region header and has been disabled.
* The block Navigation was assigned to the invalid region left and has been disabled.
* The block Who's new was assigned to the invalid region right and has been disabled.
* The block Who's online was assigned to the invalid region right and has been disabled.
* The block Attached images was assigned to the invalid region content and has been disabled.

I used the acquia bundle for the first site and am trying to duplicate it. It looks as though it's not picking up modules and themes.

www.hishousestudio.com