Site Cloning domain name references missed | Wordpress Support | Forum Archive

The free forums are no longer in use. It remains available as read-only archive.

Avatar
Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters – maximum search word length is 84 characters
The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Site Cloning domain name references missed
December 30, 2010
5:14 pm
Avatar
Guest
Guests

When I clone a site, I find burrined in various plug-ins domain name referenecs that missed inheriting the new domain name during the Clone restore.    

 

Is there a process I can follow to open the tar ball and locate all of these and replace with some kind of tag, then remake the tarball so the clone will work correctly in the future?

December 30, 2010
5:24 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

If the plugins hard-coded the old url, you most probably will find references to it in the administrator/backups/database-sql.sql file inside the backup archive, you could use a search and replace option with any text editor, save it, and retry the restore process with the new backup

 

Ovidiu

December 30, 2010
5:28 pm
Avatar
Guest
Guests

Is there any tags Xcloner uses when restoring?

December 30, 2010
6:20 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

At the moment XCloner does not use tags for this process, you could modify the restore script to do that by adding your own tag in the database and then replacing it through the XCloner.php mysql import function split_sql($sql)

 

Ovidiu

December 30, 2010
8:19 pm
Avatar
Guest
Guests

I know very little php..

Am I on the right track?  

 

function split_sql($sql) {
        $ret = array();
        $sql = str_replace(“n) “, “n) ;n#n#”, $sql);
        $sql = str_replace(“n–n”,”n#n”,$sql);
        $sql = str_replace(“n– “,”n# “,$sql);
        $sql = str_replace(“n/*”,”n#/*”,$sql);
        $sql = str_replace(“old-domain-name.tld”,”new-domain-name.tld”,$sql);
        $sql = ereg_replace(“#n”, “#;n”, $sql);
December 31, 2010
12:16 am
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Yes, that should work

Ovidiu

January 4, 2011
6:18 pm
Avatar
Guest
Guests

Can I do a similar thing with files that have phrases hard coded that I want to mass change?  How would I go about it?

 

Thanks,

Duane

January 4, 2011
8:16 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

For files it is a little bit more complicated, it might be best to update the plugin/template settings manually where needed.

 

Ovidiu

January 4, 2011
8:19 pm
Avatar
Guest
Guests

How much is “a bit more complicated”?  I'm not scared of “a bit”.   I am scared of “a lot”..  he he he

I've programed quite a bit in perl, but not anything to speak of in php..  

Is there an example you can point me to?

January 4, 2011
8:38 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Actually you would need to modify the TAR.php library, find the file extraction function, open the file for writing, get the file code, replace the code, write the file… 🙂

 

Ovidiu

Forum Timezone: America/Chicago
Most Users Ever Online: 867
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
mlguru: 30
Django29: 29
D: 21
Andy: 21
Marcus: 20
Jamie F: 19
Member Stats:
Guest Posters: 737
Members: 9628
Moderators: 2
Admins: 3
Forum Stats:
Groups: 3
Forums: 7
Topics: 2397
Posts: 8236
Newest Members:
Waldek Sik
Moderators: TriP: 0, Steve Burge: 0
Administrators: Ovidiu Liuta: 2484, Victor Drover: 1, Valentin Barbu: 0