I have encountered this issue many times. I have shifted my wordpress site from one server to another, then I had to run these queries to update the url's in the database :
UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost/dziners', 'http://www.dzin.test/');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://localhost/dziners', 'http://www.dzin.test/');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'src="http://localhost/dziners', 'src="http://www.dzin.test/');
UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost/dziners', 'http://www.dzin.test/') WHERE post_type = 'attachment';
Everything worked fine. Even the custom fields data were showing in the admin section. But when I ran this query :
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://localhost/dziners','http://www.dzin.test/');
I was unable to see the custom fields data in the admin section.
Just to confirm if the data is getting deleted what I did was, I exported the wp_postmeta table, find and replaced all the http://localhost/dziners
urls to http://www.dzin.test/
and imported it back into the database.
But still I was unable to see the data in the admin section. With this, one thing is clear that the data is there in the database but it is not showing in the admin section.
I researched on this a lot to fix this. But I couldn't find any solution to resolve this. And my full site is customised with the custom fields.
Your help will be appriciated. Please help