Required to transfer the site to WordPress. It would seem simple - transfer files, in the dump, replace the old domain with a new one and that's it.

But I ran into such a problem: WP stores settings like this: s:21:'http://localhost:8888' , i.e. s - string, 21 - the size of the next line. When replacing localhost:8888 with a new domain, it cannot parse these settings, since there is already another string length.

The lines can be like this: s:99:'asdf sadf localhost:8888 sadf asfd' .

How to transfer in this case?

PS I did not develop. I just need to make a hosting.

  • It serialize so packs. Can unpack, replace, pack, save? - Sergiks

2 answers 2

You can unpack through http://www.php.net/manual/en/function.unserialize.php

 $str = file_get_content('file.dat') $arr = unserialize ( $str ) file_put_content('file.php', var_export($arr, true)) 
  • @ALexander, if everything is so simple ... There's a dump and CREATE TABLE and stuff. I try to select and replace with regulars: hashcode.ru/questions/297356/… - Ray

define ('RELOCATE', true); in wp-config.php Then call the file wp-login.php in the address bar of the general settings and change the domain. If you change the serialization handles, then just break the plugin or template.