Database copy to different name how?

Yuki - October 24, 2009 - 15:57

Can I copy drupal datbase in another name through phpmyadmin?let me clear suppose I ve database xyz and I instaleed drupal to that database so it has tables inside.so what I want is to copy tha xyz database with tables and rename to abc offcourse that xyz database should exist there.can I do it by phpmyadmin then how?another ques if we can copy xyz to abc database can this abc database is capable to share xyz's modules and properties? Pls reply me andthnaks for UR time

If Im understanding what

Troodon - October 24, 2009 - 22:45

If Im understanding what you're asking:

  1. Download your existing database using phpmyadmin, see this for a good guide:
    Backup Process with phpMyAdmin
  2. Create a new database with your prefered name.
  3. Import your downloaded database into the new one through phpmyadmin, here's some guidance.
  4. Edit your /sites/default/settings.php file with the new database details (see around line 90).
    e.g. update $db_url = 'mysql://username:password@localhost/databasename';

Your drupal installation will now be using the new database, all the existing modules, content etc will work. There is one thing to watch out for, some hosts place a limit on the php max upload e.g. my own limits it to 8MB, even my own moderately sized Drupal site wieghs in at around 40MBs or so. If you're close to your host's limit try clearing the caches first, alternatively you'll need to get in contact with them and ask them to import the file for you.

You also might want to take a look to see whether there are any modules that might automate the process e.g. the Back up and Migrate module looks to be ideal from a cursory glance.

Very nice reply.thanks and

Yuki - October 24, 2009 - 23:45

Very nice reply.thanks and feedback to you soon. Another que, how many drupal databse is ideal for one server? If I update xyz database will it effect abc db?if I delete menuus of xyz wii it also delete abc' sites menu?

Each database is completely

Troodon - October 25, 2009 - 18:42

Each database is completely distinct and seperate. As far as Im away your site can only be connected to one at a time, after all it's not normally something you have to switch around once you've got it set up.

As to the limit of the number or any implications for running multiple dbs, that's something you should ask your webhost. I've had no problems running a couple of sites on a shared host each with its own db, but your millage may vary.

I have imported datbase in

Yuki - October 26, 2009 - 00:35

I have imported datbase in different name changed the settings of sites/default/files settings.php

$db_url = 'mysqli://root:password@localhost/mynewdatabasename

but I am getting below message while accessing the site:

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.

Here noted that previous db url also there:

$db_url = 'mysqli://root:password@localhost/previousatabasename

Hello, Has the only thing

Troodon - October 27, 2009 - 19:48

Hello,

Has the only thing that's changed is the database you're trying to connect to? e.g. you havent moved the files on the host to a new location, you've just created the new db, uploaded the old one into it and updated your settings.php

Do you only have one $db_url in your settings.php? e.g. comment out the old one.

Have you checked that the username and password for the new database are correct?

Yes I have just imported the

Yuki - October 28, 2009 - 10:44

Yes I have just imported the dump(sql) to my new db(suppose abc). I havent moved anything. My previous site is working still but when I type new url(new db name: url http://ipadress/abc) thats giving "object not found". Suppose my previous db name is xyz, its working and new db is abc, thats still not workig after changing settings on settings.php - $db_url

I havent changed any password or username. Its same as xyz db's paswword and user name.

What new URL? The only thing

Troodon - October 28, 2009 - 16:41

What new URL? The only thing you've changed is the database your site is connecting to so the url should be the same? Or have you copied the site to a new address? If so you might need to update the base_url variable.

Perhaps though it might be time to get some help from someone more experienced.

Sorry d=for the delay but I

Yuki - November 12, 2009 - 10:30

Sorry for the delay but I still couldnt found the soultion. How to update the base_url variable?

what do u mean by "Or have you copied the site to a new address? "

Hello, What I was trying to

Troodon - November 12, 2009 - 18:08

Hello,

What I was trying to find out is whether what you asked what you wanted to do was what you actually intented :)

i.e. you asked how to copy/rename the database, but further on in this thread I kind of got the impression you were instead moving the site to a new domain/directory etc.

Regarding the base_url variable there are some examples in the settings.php text e.g.
if your site is in the top directory that your webhost points your domain to just use: $base_url = 'http://www.example.com';
But if your site is in subdirectory from where the domain points to e.g. www.example.com/drupal use $base_url = 'http://www.example.com/drupal';

Let me clear it again to you.

Yuki - November 13, 2009 - 02:37

Let me clear it again to you. Sorry if I am bothering you and others.

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. (As you have instructed in your first post)
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.)
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

SO HOW CAN I GET WORK WITH SECOND URL(http://ipdaress/xyz) whats other stpes I need to do?
( WHICH WILL SHARE SAME MODULE LIKE "ABC" WEBSITE?)

Let me clear it again to you.

Yuki - November 13, 2009 - 02:38

Let me clear it again to you. Sorry if I am bothering you and others.

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. (As you have instructed in your first post)
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.)
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

SO HOW CAN I GET WORK WITH SECOND URL(http://ipdaress/xyz) whats other stpes I need to do?
( WHICH WILL SHARE SAME MODULE LIKE "ABC" WEBSITE?)

Let me clear it again to

Yuki - November 13, 2009 - 02:38

Let me clear it again to you. Sorry if I am bothering you and others.

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. (As you have instructed in your first post)
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.)
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

SO HOW CAN I GET WORK WITH SECOND URL(http://ipdaress/xyz) whats other stpes I need to do?
( WHICH WILL SHARE SAME MODULE LIKE "ABC" WEBSITE?)

Let me clear it again to you.

Yuki - November 13, 2009 - 02:39

Let me clear it again to you. Sorry if I am bothering you and others.

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. (As you have instructed in your first post)
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.)
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

SO HOW CAN I GET WORK WITH SECOND URL(http://ipdaress/xyz) whats other stpes I need to do?
( WHICH WILL SHARE SAME MODULE LIKE "ABC" WEBSITE?)

I would be grateful if

Yuki - November 17, 2009 - 13:01

I would be grateful if someone of you give me a solution of this issue.

 
 

Drupal is a registered trademark of Dries Buytaert.