I move the staging from one machine to another, server. Port 80 was taken and used by by other applications, so I need to move to a different port, e.g. 8080 and for ssl 8443.
I’m using 8080 for testing now.
I changed the hostname:port, in siteurl and home value in the database. Also, using Elementor > Tools > Permalink I did save with the correct port. Dumping the database shows there are still many instances that are not changed. I noticed that since some images were not loading.
By replacing them using string replacement arrays break, and I get a php errors for unserialized values. I just left a part of one row below (of many). As we can see, the length of the path precedes the value (e.g. in this case 89 is the length ;s:89:\”http://localhost/wordpress/wp-content/uploads/custom-fonts/2025/08/RedditSans-Regular.ttf\”;) . There were recommendations for using wp-cli search-replace, but that did match anything.
..\..\php\wp.bat search-replace ‘localhost/wordpress’ ‘localhost:8080/wordpress’ –all-tables –dry-run
How to replace the hostname, and ensure the serialized data length is corrected.
INSERT INTO wp_options (option_id, option_name, option_value, autoload) VALUES
[…],
(629, ‘etheme-fonts’, ‘a:3:{i:0;a:4:{s:2:\”id\”;i:8185126;s:4:\”name\”;s:18:\”RedditSans-Regular\”;s:4:\”file\”;a:6:{s:4:\”name\”;s:22:\”RedditSans-Regular.ttf\”;s:4:\”type\”;s:24:\”application/octet-stream\”;s:4:\”size\”;i:134428;s:9:\”extension\”;s:3:\”ttf\”;s:4:\”time\”;s:19:\”2025-08-10 06:52:07\”;s:3:\”url\”;s:89:\”http://localhost/wordpress/wp-content/uploads/custom-fonts/2025/08/RedditSans-Regular.ttf\”;}s:4:\”user\”;a:3:{s:10:\”user_email\”;s:8:\”imported\”;s:10:\”user_login\”;s:8:\”imported\”;s:5:\”roles\”;s:8:\”imported\”;}}i:1;a:4:{s:2:\”id\”;i:2331787;s:4:\”name\”;s:19:\”RedditSans-SemiBold\”;s:4:\”file\”;a:6:{s:4:\”name\”;s:23:\”RedditSans-SemiBold.ttf\”;s:4:\”type\”;s:24:\”application/octet-stream\”;s:4:\”size\”;i:135000;s:9:\”extension\”;s:3:\”ttf\”;s:4:\”time\”;s:19:\”2025-08-10 06:52:08\”;s:3:\”url\”;s:90:\”http://localhost/wordpress/wp-content/uploads/custom-fonts/2025/08/RedditSans-SemiBold.ttf\”;}s:4:\”user\”;a:3:{s:10:\”user_email\”;s:8:\”imported\”;s:10:\”user_login\”;s:8:\”imported\”;s:5:\”roles\”;s:8:\”imported\”;}}i:2;a:4:{s:2:\”id\”;i:9006941;s:4:\”name\”;s:17:\”RedditSans-Medium\”;s:4:\”file\”;a:6:{s:4:\”name\”;s:21:\”RedditSans-Medium.ttf\”;s:4:\”type\”;s:24:\”application/octet-stream\”;s:4:\”size\”;i:134840;s:9:\”extension\”;s:3:\”ttf\”;s:4:\”time\”;s:19:\”2025-08-10 06:52:09\”;s:3:\”url\”;s:88:\”http://localhost/wordpress/wp-content/uploads/custom-fonts/2025/08/RedditSans-Medium.ttf\”;}s:4:\”user\”;a:3:{s:10:\”user_email\”;s:8:\”imported\”;s:10:\”user_login\”;s:8:\”imported\”;s:5:\”roles\”;s:8:\”imported\”;}}}’, ‘auto’),
[…],