I currently am moving over a site from one domain to another and I would like to also change the table prefixes so they correctly match up with the site. Currently all the database tables, except for 'authmap, sessions, users, role, sessions and sequences, have a prefix of 'site1_' the others have a 'shared_' prefix.

When I do a batch RENAME TABLE to change the tables, is there anything in the 'shared_' tables that I also have to change?

Thanks!

CommentFileSizeAuthor
#5 prefix.php_.txt5.35 KBakaserer

Comments

ainigma32’s picture

Status: Active » Postponed (maintainer needs more info)

I think you should be OK without changing the shared_ tables. Just remember to change the prefix in settings.php too.

Please post back how the rename works out for you.

- Arie

bsherwood’s picture

Status: Postponed (maintainer needs more info) » Fixed

I noticed in the 'shared_sequences' table that some fields had the old prefixes. So I updated them to the new table prefix as well.

The transition went fairly smooth:

1. Backed up ALL files, databases, etc...
2. Moved site (Drupal files) over to new domain.
3. Changed table prefixes on database
4. Updated settings.php. Changed database hostname and updated database array variable in settings.php to use new table prefixes).
5. Accessed site at new domain. Voila! It worked.

In fact, my only real issue came up when I tried to redirect my old domain to the new domain.

All URL's (Pathauto) would remain the same, I just needed a "MOVED PERMANENTLY" HTTP code to redirect everything over. My domains are registered at godaddy.com and I host at Dreamhost. I moved the nameserver info back to godaddy and forwarded the site over but it didn't work.

I then sent the nameserver settings back over to Dreamhost and configured the site to redirect from their panel. It worked.

I plan on just keeping it that way for a few months so that the search engines "see" it and update my pages. Maybe when I am bored I will try sending it back over to godaddy.com and redirect from there, but in the meantime, everything is working fine.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

not_Dries_Buytaert’s picture

The procedure described by 'bsherwood' worked for me:
Ad 1) I exported the database using version 6.x-1.2 of the "Backup and Migrate" module (http://drupal.org/project/backup_migrate), but I guess any backup/ export tool will do.
Ad 3) I replaced the old with the new table name within the backup file using a text editor (such as http://notepad-plus.sourceforge.net).

A more user-friendly solution with a GUI is proposed here: http://drupal.org/node/196936

I suspect the redirection issue described by 'bsherwood' is off-topic: certain configuration settings (stored in the database file) could still contain some old domainname related settings, such as for the locations of multisite files ("sites/{domainname}/files/") and themes ("sites/{domainname}/themes/"). If not, the cause of the issue has likely to do with the configuration of the hosting and/ or domainname (server).

akaserer’s picture

StatusFileSize
new5.35 KB

hi

i found this script to change table prefixes.

seems like the prefix filter does not work.

does anybody know why?