cloning drupal sites to create new ones
etgraphicd2 - November 19, 2009 - 18:09
Hello,
I have a question that might sound silly.
I am still new at drupal and I was wondering if this is an acceptable practice:
I recently developed a drupal site on my local mamp installation on my desktop
and successfully launched it to a remote server and re-routed the links and database
associated with that particular site.
Now here is the question: Can I now use the local drupal site left on my mamp installation to
create a entirely different site and launch it to a remote server later without any problems?
Are there any connections to the first launched site that could cause problems for me down the road?
Can anyone answer this for me?
Thanks in advance,
Edward

A lot of the content, menu
A lot of the content, menu items, etc are stored in the database, so you probably want to at least create a new database and change your settings.php to point to the new db.
- Ryan
"change your settings.php to
"change your settings.php to point to the new db." how?
(BTW this method is not working. if you successful let us know kindly elaborately how u did it.)
Look for settings.php in your
Look for settings.php in your drupal installation folder under sites/default. Open it up and look for the $db_url variable. That will show a login and connection address for your database. I think this will work, I haven't tried and tested myself. Let me know how it goes.
- Ryan
I have tried more than 10
I have tried more than 10 times but not working. You can test yourself.
install.php
Sorry, then go to http://localhost/your-drupal-directory/install.php. You should be set after that.
- Ryan
Can you explain more clearly?
Can you explain more clearly?
re-using drupal mamp installation
Hello Ryan,
So, as long as I change out the datatbase and re-route all external links I should be able to reuse my mamp installation of drupal for as many different sites as I wish?
Is this correct? Let me know.
Thanks again,
Edward
If you only intend on
If you only intend on running/working on one site at a time, then that should work: make a new database, reference it in your settings.php, and run install.php.
If you want to have multiple sites running on one drupal installation, this is also possible, but a bit more complicated. You can learn a lot more here: http://drupal.org/getting-started/6/install/multi-site
Yuki, I'm not sure how to make it easier. Do you have any specific questions? Which part are you getting stuck on?
- Ryan
reusing drupal mamp installations
Hello Ryan,
I will check out the link you sent; I don't have anymore questions right now regarding the duplication of a drupal site to reuse as a new and different site. But I do have 2 other questions on another subject if you don't mind.
1) I have recently installed the Ad module for running ad banners on the side bar area of my site
and from time to time I get this message: "ad module cache has been flushed to the database" which
visitors can also see. Is there a way to prevent this that you know of?
2) I have been wondering how to link a external javascript.js file to content in my drupal pages since there are no "head tags" available to paste the code into. I ran across a paragraph in the "Drupal 6 JavaScript and jQuery" book review that offered this solution:
"Second, the code can be loaded separately from the rest of the HTML. Again, this is usually done using the and tags. However, instead of putting the code between the tags, we use the src attribute to instruct the browser to retrieve an additional document from the server."
In this example, src="some/script.js" points the browser to an additional script file stored on the same server as the HTML document in which this script tag is embedded. So, if the HTML is located at http://example.com/index.html, the browser will request the script file using the URL http://example.com/some/script.js.
I tried this on one section code and it worked fine; but I tried it on several other occasions and it would not work.
Is there a tried and true way to link external javascript.js files to page content without getting too complicated?
If you have answers I would greatly appreciate your sharing the knowledge.
Thanks,
Edward
1) Not sure on this one, I'm
1) Not sure on this one, I'm not familiar with the Ad module. And I'm not sure what the best method to hide certain warnings from end users is. The first thing that comes to mind is only showing the $messages variable to the user roles you want, but that doesn't seem like a very good solution. Maybe there are contributed modules that do this sort of thing?
2) This one is much easier. Open up the .info file for your theme and look for this bit of code:
; Optionally add some jquery scripts to your theme.
; scripts[] = script.js
and add a line below it like this:
scripts[] = myownscript.jsThis will look for the myownscript.js in your themes directory, so if you want it somewhere else, like a scripts folder it would be scripts[] = scripts/myownscript.js.
- Ryan
external javascript files
Ryan,
If I use your example "scripts[] = scripts/myownscript.js" added in my .info file
I would still need to point to that script in my drupal page body section with this:
"script type = " text / javascript " src= " js_folder/myownscript.js "/script"
right?
So basically this does the same as what I mentioned above, but by adding your suggested code to the .info file it gives
an extra added pointer for drupal to locate the script, right?
Let me know if I am understanding this correctly. I plan to try it.
Thanks again,
Edward
When you add that line of
When you add that line of code to your .info file, what you are doing is adding another script file to the $scripts array variable. This variable is called by drupal themes in the page header. In other words, once you add it to your .info file, that javascript file will be loaded onto every drupal page like so:
<script type="text/javascript" src="myscript.js"></script>So no you don't have to add anything else to your pages. If you look at your page.tpl.php you will notice the $scripts variable being printed after the $styles.
- Ryan
Dear Ryan, I need the
Dear Ryan,
I need the multisite feature as of my client so I did below(two way):
Sorry if I am bothering you and others.
Let me clear it:
I have one drupal database say "abc"
I have created another database in same machine say "xyz" and have imported
"abc" drupal sites dump into xyz 's database through phpmyadmin (no problem occured).
So we have two database in one machine: one is "abc" and another is "xyz" with same table structure.
My first abc databse url is: http://ipdaress/abc
and my newly imported databse url (might be) is http://ipdaress/xyz
(Here noted that I am using xampp, mysql in windows 2003 machine.)
FIRST WAY:
I havent changed any folders, passwords anything inside sites directory or in database or anywhere.
Only one change is in my settings.php file(under sites\default) I just added below lines:
$db_url = 'mysqli://root:password@localhost/xyz';
So the the total lines are below:
$db_url = 'mysqli://root:password@localhost/abc'; (previous ones whic autimatically written when I did setup abc drupal site)
$db_url = 'mysqli://root:password@localhost/xyz'; (I just copy pest and change the abc to xyz)
$db_prefix = '';
The directory structure is like below under sites:
sites
--- all
------modules
------themes
---default
------files
------default.settings.php
------settings.php
Now when in internet explorer I put http://ipdaress/abc its OK working.
but when I put http://ipdaress/xyz
I am now getting below message:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
IPADDRESS
11/13/09 11:18:32
Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h mod_autoindex_color PHP/5.2
SECOND WAY:
AFTER READING THE ARTICLES WHAT YOU HAVE PROVIDED, I HAVE CREATED TWO FOLDERS INSIDE SITES DIRECTORY, ONE THAT ALREADY HAS ABC/DEFAULT AND NEW MANUALLY COPYING DEFAULT DIRECTORY AND RENAMED IT TO "XYZ":
SO THE DIRECTORY STRUCTURES ARE LIKE BELOW:
sites
--- all
------modules
------themes
---default
------files
------default.settings.php
------settings.php
---XYZ
------files
------default.settings.php
------settings.php
NOW AGAIN I HAVE CHANGED THE DB URL OF XYZ FOLDERS SETTINGS.PHP AND HIT THE URL TO MY BROWSER
$db_url = 'mysqli://root:password@localhost/xyz'; (I HAVE DELETED THE ABC DATABASE LINE)
SAME OBJECT NOT FOUND.
SO HOW CAN I GET WORK WITH SECOND URL(http://ipdaress/xyz) whats other steps I need to do?
(WHICH WILL SHARE SAME MODULE LIKE "ABC" WEBSITE?)
i HAVE TRIED AND READ MANY ARTICLES BUT COULDN'T GET WHERE IS MY PROBLEM.
I would be grateful to u if i get solution.Thanks many for your time.
Hi Yuki! I think this part is
Hi Yuki!
I think this part is your problem:
<?php$db_url = 'mysqli://root:password@localhost/abc';
$db_url = 'mysqli://root:password@localhost/xyz';
$db_prefix = '';
?>
You need to point to each database individually in its settings.php file.
So in the settings.php located in sites/XYZ use the second line only:
$db_url = 'mysqli://root:password@localhost/xyz';
Check this link: http://drupal.org/getting-started/6/install/multi-site and explore the rest of the book for more information on your specific setup.
- Ryan
I have used second line for
I have used second line for the xyz only but still object not found message is coming.
I have read through all the docs but cant figure out to work in xampp.