Site Split & change table prefix
Site Split & change table prefix
I have an internal site which has many contents and I want to split it into three sites.
The requirements:
(1) Site A duplicates to Site B
(2) Site A duplicates to Site C
(3) Change the table prefix from "site_a_" to "site_b_" for Site B
(4) Change the table prefix from "site_a_" to "site_c_" for Site C
Please advise how to do this.
Site A is using version 1.11.2.
The requirements:
(1) Site A duplicates to Site B
(2) Site A duplicates to Site C
(3) Change the table prefix from "site_a_" to "site_b_" for Site B
(4) Change the table prefix from "site_a_" to "site_c_" for Site C
Please advise how to do this.
Site A is using version 1.11.2.
Re: Site Split & change table prefix
For what reason do you want to do this ?
Re: Site Split & change table prefix
[quote="applejack"]For what reason do you want to do this ?[/quote
Just to be clear and make less confusing.
Initially I put "Windows Howto" and "Linux Howto" into one site and now there are a lot of contents inside it and I want to split into two sites - one is Windows Howto and another is Linux Howto. Tables in Windows Howto site will start with "howto_windows_" and tables in Linux Howto will start with "howto_linux_".
Just to be clear and make less confusing.
Initially I put "Windows Howto" and "Linux Howto" into one site and now there are a lot of contents inside it and I want to split into two sites - one is Windows Howto and another is Linux Howto. Tables in Windows Howto site will start with "howto_windows_" and tables in Linux Howto will start with "howto_linux_".
Re: Site Split & change table prefix
Why not just use 3 different databases named accordingly if you can.
Re: Site Split & change table prefix
Yes, I'm using three databases but I'm not sure if the table prefix names can be modified. If not, this is the acceptable solution as well.
Re: Site Split & change table prefix
You can call the table prefixes whatever you like.
Re: Site Split & change table prefix
Not sure if I need to modify the config.php:applejack wrote:You can call the table prefixes whatever you like.
$config['db_prefix'] = 'my_prefix_';
You mean just rename the tables with a new prefix and then restart Apache and cmsms will work?
Re: Site Split & change table prefix
Yes and yes you do need to change the config setting.
Re: Site Split & change table prefix
I tried:applejack wrote:Yes and yes you do need to change the config setting.
(1) renamed ALL the table prefix
(2) changed $config['db_name'] = 'my_new_prefix';
(3) restart MySQL & Apache
But CMS only show the first page and the rest of the contents are gone. It seems that there must be some programs in CMSMS that hard coded the table prefix.
So, there should be more to be done to rename table prefix.
Re: Site Split & change table prefix
Clear the cache in admin. Are you using mod rewrite for SEO friendly url's. Double check any htaccess and config files. Check server error logs. You can also switch on debug in the config file.
Re: Site Split & change table prefix
Yes, cache cleared. I'm using "mod_rewrite" for pretty URL.applejack wrote:Clear the cache in admin. Are you using mod rewrite for SEO friendly url's. Double check any htaccess and config files. Check server error logs. You can also switch on debug in the config file.
I tried a newly install cmsms and the contents are all gone after renamename of table prefixes.
Table prefixes before: new_install_
Table prefixed after rename: fresh_install_
Config.php:
...
$config['db_name'] = 'new_install'; <-- db name unchanged
$config['db_port'] = 0;
$config['db_prefix'] = 'fresh_install_'; <-- table prefix changed
...
After rename, both Apache and MySQL have been restarted.
Admin log: Contents gone after rename: Table structure error as shown by cmsms: