News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How to modify the directory for all custom themes with SQL?

Started by drroot, November 28, 2009, 03:35:53 AM

Previous topic - Next topic

drroot

I have moved to a new host, and need to fix the directory for custom themes.

The repair_settings.php could only fix the default theme.

Although I could modify the path in the "Themes and Settings", but I have more than 30 themes.

Everytime I change a host, this fix will take me lots of time.

I think there path should be stored in the sql database.
Any idea to fix it with SQL?

Great thanks.


Arantor

I believe there is an updated version of repair_settings.php that will take care of this.

That said until it is ready: (assuming smf_ is the prefix)
UPDATE smf_themes SET value = REPLACE (value, 'oldhost.com/Themes', 'newhost.com/Themes') WHERE variable = 'themeurl' OR variable = 'imageurl';
UPDATE smf_themes SET value = REPLACE(value, '/home/user/public_html/Themes', '/home/newuser/public_html/Themes') WHERE variable = 'themedir';


Note you don't include the themes' own folders here, just the parent Themes folder, and this needs to be done for the images and primary theme URL, plus the path updated for the main folder on the server itself (the second query)

drroot

Where should I insert this code into repair-settings.php?

I've tried the original repair-settings.php just downloaded from SMF, but not works for the custom themes.


Quote from: Arantor on November 28, 2009, 06:41:52 AM
I believe there is an updated version of repair_settings.php that will take care of this.

That said until it is ready: (assuming smf_ is the prefix)
UPDATE smf_themes SET value = REPLACE (value, 'oldhost.com/Themes', 'newhost.com/Themes') WHERE variable = 'themeurl' OR variable = 'imageurl';
UPDATE smf_themes SET value = REPLACE(value, '/home/user/public_html/Themes', '/home/newuser/public_html/Themes') WHERE variable = 'themedir';


Note you don't include the themes' own folders here, just the parent Themes folder, and this needs to be done for the images and primary theme URL, plus the path updated for the main folder on the server itself (the second query)

Arantor

You don't add it to repair settings. You run that manually since it needs both your old and new paths.

Or you wait for the updated version to be released.

Advertisement: