You can use this tool to Search/Replace for WordPress databases.
It works outside of WP, https://github.com/interconnectit/Search-Replace-DB/releases
Hi Yui,
Thanks for your advice.
You can use this tool to Search/Replace for WordPress databases.
I’m not familiar with “Search/Replace for WordPress databases”
Whether I can change the database on MariaDB?
I have created a database for each cloned site on VM of VirtualBox. I can login MariaDB to locate the corresponding database. Can I change the local IP addressfrom 192.168.0.xxx to 192.168.1.xxx
from there?
Thanks
Regards
This tool does same with this plugin
https://wordpress.org/plugins/better-search-replace/
But it does not need WordPress dashboard access.
Search for OLDIP
Replace with NEWIP
All tables, to make your site work, changing siteurl and wordpress url in wp_options table will be enough, but attachments and other settings probably will be broken. Thats why you have to change All tables.
This tool and mentioned plugin does correctly handle serialized data (where most theme settings are saved)
Hi Yui
On the cloned site;
Plugin -> Add New
Search better-search-replace
I found it there.
If I understand your advice correct.
Just install the said plugin and start it to make correction there?
Change from;192.168.0.xxx to 192.168.1.xxx
Thanks
Regards
Yes, and dont forget to select all tables and remove “Dry run” checkbox, otherwise no changes will be made
Hi Yui,
Sorry, I made a mistake. I found better-search-replace plugin on the live site.
On the cloned site on VM, I could start it, all graphic lost. But I could not start the login page.
On Firefox browser, it popup;
http://192.168.0.xxx/cloned_site/wp-login.php
The connection has timed out
http://192.168.1.xxx/cloned_site/wp-login.php
The connection has timed out
It is the same.
Can I do something on wp-login.php? If YES, please advise HOW?
Thanks
Regards
You can clone with Duplicator again
and reinstall package using Duplicator installer again on your target test system.
Hi Yui,
Yes, I can do it from grass-root again.
I wonder whether this is a better and easy way to do it rather than;
Delete the old installation and re-install the packages;
....archive.daf
installer.php
Regards
Hi Yui,
Following steps help me solving half problem.
$ sudo mariadb -u root -p
MariaDB [(none)]> SHOW databases;
+--------------------+
| Database |
+--------------------+
| dietDB |
| geriatricDB |
| hongkongDB |
| information_schema |
| localDB |
| localDB02 |
| mysql |
| performance_schema |
| phgallery1DB |
| phgallery2DB |
| phgallery3DB |
| phgallery4DB |
| satimisDB |
| worldDB |
+--------------------+
> use dietDB;
Database changed
MariaDB [dietDB]> select * from wp_options where option_id=1;
+-----------+-------------+---------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+---------------------------+----------+
| 1 | siteurl | http://192.168.0.xxx/diet | yes |
+-----------+-------------+---------------------------+----------+
MariaDB [dietDB] >; update wp_options set option_value="http://192.168.1.xxx/diet" where option_id=1;
Query OK, 0 rows affected (0.000 sec)
Rows matched: 1 Changed: 0 Warnings: 0
MariaDB [dietDB]> exit
$ sudo systemctl restart mariadb
Now I can start the cloned site but background graphic disappeared.
Login the cloned site;
Settings –> General
change
Site Address (URL)
from 192.168.0.xxx/diet/
to 192.168.1.xxx/diet/
–> Save
Still all photos and graphic images disappear.
Do I need to install better-search-replace plugin to work again?
Regards
Hi Yui,
Problem solved as follows;
Install better-search-replace plugin
Then run;
Tools -> Better Search Replace
Search for [192.168.0.xxx]
Replace with [192.168.1.xxx]
Select all on “Select tables”
-> uncheck “Run as dry run?”
-> [Run Search/Replace]
Now the cloned site works without problem with all graphics displayed.
Thanks
Regards