Title: Problem migrate website
Last modified: August 22, 2016

---

# Problem migrate website

 *  Resolved [kikko088](https://wordpress.org/support/users/kikko088/)
 * (@kikko088)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/problem-migrate-website/)
 * I create a local website, with some custom post type, this custom post has a 
   cmb2 gallery (file list), all work but when I try to migrate the website I encounter
   some problems, what I do is:
 * export sql db,
    with a text editor I replace all url localhost to mywebsite.com
   import this new db
 * everything work except cmb2 gallery, after replace the url all the gallery are
   empty, and the strange thing is that if I replace another time the url from mywebsite.
   com to localhost all work…
 * where is the mistake?
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [kikko088](https://wordpress.org/support/users/kikko088/)
 * (@kikko088)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465300)
 * the file_list field save the files path into “wp_postmeta” tables, I search and
   find the field inside wp_postmeta table, the field is an array of images, if 
   I change manually the url of the first image the field disappear from backoffice.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 7 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465452)
 * Just as a check, are you referencing your domain in the template files where 
   you’re displaying the gallery?
 * Also curious if the data is being stored as serialized data, which is a bit more
   fragile than ideal, since it stores a count of the characters in strings and 
   whatnot. If the localhost url and the end result url aren’t the same, then that
   count number needs to be changed to match the new end result url count. Otherwise,
   it’ll drop its data.
 *  Thread Starter [kikko088](https://wordpress.org/support/users/kikko088/)
 * (@kikko088)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465538)
 * Into the template there is no absolute url, only relative so i think is not the
   problem, where can be stored the URL count?there is another way for export and
   import file_list custom fields?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465539)
 * They’re all going to be part of your wp_postmeta table, so if that’s been brought
   over, then they’re in the new place. The question is how they’re being stored
   in the DB and if they have full urls associated or perhaps just attachment ID.
 * If you could, paste one of the gallery fields you have in the old location. Right
   from the wp_postmeta table if possible and you’re comfortable with that much.
 *  Thread Starter [kikko088](https://wordpress.org/support/users/kikko088/)
 * (@kikko088)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465540)
 * This is one gallery field:
    `a:14:{i:596;s:88:"http://localhost:8888/site/wp-
   content/uploads/2014/10/C-47-LC-7584.jpg";i:597;s:91:"http://localhost:8888/site/
   wp-content/uploads/2014/10/C-47-LC-4849277.jpg";i:598;s:91:"http://localhost:
   8888/site/wp-content/uploads/2014/10/C-47-LC-4849273.jpg";i:599;s:91:"http://
   localhost:8888/site/wp-content/uploads/2014/10/C-47-LC-4848793.jpg";i:600;s:91:"
   http://localhost:8888/site/wp-content/uploads/2014/10/C-47-LC-4848792.jpg";i:
   601;s:93:"http://localhost:8888/site/wp-content/uploads/2014/10/C-47-LC-4848792-
   1.jpg";i:602;s:91:"http://localhost:8888/site/wp-content/uploads/2014/10/C-47-
   LC-4848791.jpg";i:603;s:91:"http://localhost:8888/site/wp-content/uploads/2014/
   10/C-47-LC-4848790.jpg";i:604;s:91:"http://localhost:8888/site/wp-content/uploads/
   2014/10/C-47-LC-4848789.jpg";i:605;s:91:"http://localhost:8888/site/wp-content/
   uploads/2014/10/C-47-LC-4848787.jpg";i:606;s:91:"http://localhost:8888/site/wp-
   content/uploads/2014/10/C-47-LC-4848784.jpg";i:607;s:91:"http://localhost:8888/
   site/wp-content/uploads/2014/10/C-47-LC-4848781.jpg";i:608;s:91:"http://localhost:
   8888/site/wp-content/uploads/2014/10/C-47-LC-4848779.jpg";i:609;s:91:"http://
   localhost:8888/site/wp-content/uploads/2014/10/C-47-LC-4848777.jpg";}`
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465544)
 * As I suspected.
 * All of the “htttp://localhost:8888/site/…” urls are going to need to be changed
   to match the new domain.
 * As an example:
 *     ```
       s:88:"http://localhost:8888/site/wp-content/uploads/2014/10/C-47-LC-7584.jpg"
       ```
   
 * the “s:88” means “string” for data type of the url, and the 88 means the url 
   is 88 characters long.
 * If I were to change that by hand or via find/replace, and the new url wasn’t 
   the same length as the new url, the whole meta field gets dropped if I’m not 
   mistaken.
 *     ```
       s:88:"http://mysite.com/wp-content/uploads/2014/10/C-47-LC-7584.jpg"
       ```
   
 * Above would drop it because it’s only 61 characters long.
 *     ```
       s:61:"http://mysite.com/wp-content/uploads/2014/10/C-47-LC-7584.jpg"
       ```
   
 * Would be fine because the count matches the length again.
 * Not sure what the best tool is out there for this topic regarding serialized 
   data, unless you’re willing to pay for a premium plugin.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Problem migrate website’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/problem-migrate-website/#post-5465544)
 * Status: resolved