wp-config remove old dbase info | Feature Request | Free Forums

All Wordpress Forum requests have been moved to Wordpress Support Forums

 

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
wp-config remove old dbase info
November 16, 2010
5:55 am
Avatar
davidjp
Member
Forum Posts: 6
Member Since:
September 30, 2010
sp_UserOfflineSmall Offline

Hi,

 

Is it possible to have xcloner not keep the old database info (name, user, pw) when installing a clone?

Also, how about having it generate a new "AUTH_KEY" etc..

This will save me having to manually edit the wp-config file whenever i install a clone.

 

Thanks,

 

David

November 16, 2010
8:33 am
Avatar
XCloner! Support
Admin
Forum Posts: 2485
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Hi David! When doing a restore, XCloner updates the new config file with the new mysql details, and comments the others, if it does not do this however, there might be a restore issue, did you receive the success message on the configuration update?

 

As for AUTH_KEY, we will need to look into that to see if changing it will affect the site functionality.

 

Regards, Ovidiu

Please consider our XCloner Premium Support or making a Donation XCloner.com – Backup Made Easy!
November 16, 2010
10:50 am
Avatar
davidjp
Member
Forum Posts: 6
Member Since:
September 30, 2010
sp_UserOfflineSmall Offline

Yep, restore was successfull, but now i need to go in and remove the commenting out of the old database info.

I think i can hack the xcloner.php file not to include the old info, but think this should be a checkbox option.

 

David

November 16, 2010
11:16 am
Avatar
XCloner! Support
Admin
Forum Posts: 2485
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

XCloner tries to keep the files as intact as possible during a restore, it only updates the necessary config options, rewriting the wp-config file would require indeed more coding which might lead to more points of error, we will consider however the checkbox option

 

Regards, Ovidiu

Please consider our XCloner Premium Support or making a Donation XCloner.com – Backup Made Easy!
November 16, 2010
1:21 pm
Avatar
davidjp
Member
Forum Posts: 6
Member Since:
September 30, 2010
sp_UserOfflineSmall Offline

$config_data = preg_replace("define('DB_HOST.*", "define('DB_HOST', '".$_REQUEST[mysql_server]."');#", $config_data);

 

is giving me an error- little help?

David

November 16, 2010
1:41 pm
Avatar
XCloner! Support
Admin
Forum Posts: 2485
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Try this code

 

$config_data = preg_replace("/define\('DB_HOST(.*)/i", "define('DB_HOST', '".$_REQUEST[mysql_server]."');#", $config_data);

 

let me know if it works

 

Ovidiu

Please consider our XCloner Premium Support or making a Donation XCloner.com – Backup Made Easy!
November 16, 2010
2:00 pm
Avatar
davidjp
Member
Forum Posts: 6
Member Since:
September 30, 2010
sp_UserOfflineSmall Offline

$config_data = preg_replace("/define\('DB_HOST(.*)/i", "define('DB_HOST', '".$_REQUEST[mysql_server]."');#", $config_data);
$config_data = preg_replace("/define\('DB_USER(.*)/i", "define('DB_USER', '".$_REQUEST[mysql_username]."');#", $config_data);
$config_data = preg_replace("/define('DB_PASSWORD(.*)/i", "define('DB_PASSWORD', '".$_REQUEST[mysql_pass]."');#", $config_data);
$config_data = preg_replace("/define('DB_NAME(.*)/i", "define('DB_NAME', '".$_REQUEST[mysql_db]."');#", $config_data);

 

Warning: preg_replace() [function.preg-replace]: Compilation failed: missing ) at offset 23

November 16, 2010
2:36 pm
Avatar
XCloner! Support
Admin
Forum Posts: 2485
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Check your last 2 lines, the define( should be replace with define\(

 

Ovidiu

Please consider our XCloner Premium Support or making a Donation XCloner.com – Backup Made Easy!
November 16, 2010
3:05 pm
Avatar
davidjp
Member
Forum Posts: 6
Member Since:
September 30, 2010
sp_UserOfflineSmall Offline

Awesome- worked perfectly:

 

$config_data = preg_replace("/define\('AUTH_KEY(.*)/i", "define('AUTH_KEY', '".$randomkey."authkey');#", $config_data);
$config_data = preg_replace("/define\('SECURE_AUTH_KEY(.*)/i", "define('SECURE_AUTH_KEY', '".$randomkey."secureauthkey');#", $config_data);
$config_data = preg_replace("/define\('LOGGED_IN_KEY(.*)/i", "define('LOGGED_IN_KEY', '".$randomkey."loggedinkey');#", $config_data);
$config_data = preg_replace("/define\('NONCE_KEY(.*)/i", "define('NONCE_KEY', '".$randomkey."noncekey');#", $config_data);
$config_data = preg_replace("/define\('AUTH_SALT(.*)/i", "define('AUTH_SALT', '".$randomkey."authsalt');#", $config_data);
$config_data = preg_replace("/define\('SECURE_AUTH_SALT(.*)/i", "define('SECURE_AUTH_SALT', '".$randomkey."securesalt');#", $config_data);
$config_data = preg_replace("/define\('LOGGED_IN_SALT(.*)/i", "define('LOGGED_IN_SALT', '".$randomkey."loggedsalt');#", $config_data);
$config_data = preg_replace("/define\('NONCE_SALT(.*)/i", "define('NONCE_SALT', '".$randomkey."noncesalt');#", $config_data);

 

Thanks,

 

David

November 16, 2010
3:15 pm
Avatar
XCloner! Support
Admin
Forum Posts: 2485
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Thank you for sharing, i will look into getting this code added in the restore script for the main package

 

Regards, Ovidiu

Please consider our XCloner Premium Support or making a Donation XCloner.com – Backup Made Easy!
Forum Timezone: UTC 0

Most Users Ever Online: 867

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tom_1: 70

mlguru: 33

Django29: 29

D: 21

Andy: 21

Marcus: 20

Member Stats:

Guest Posters: 737

Members: 41549

Moderators: 1

Admins: 1

Forum Stats:

Groups: 3

Forums: 7

Topics: 2517

Posts: 8419

Newest Members:

Speakernbz Speakernbz

Moderators: Ovidiu - Support!: 0

Administrators: XCloner! Support: 2485

Quick contact

place

Hi there, my name is Ovidiu Liuta and i support the XCloner! project
XCloner is a Joomla backup component, Wordpress backup plugin and Free website backup tool.
Contact me here!

About company

XCloner.com is a dynamic company focusing on providing backup and recovery solutions for small to medium websites.
We are based in Romania and offer 24/7 support through forums and our private ticket system for Premium users support.

© 2020 XCloner - Website Backup and Restore made simple
All Rights Reserved | Privacy Policy