How can I assign post a specific ID on creation?

Yes, use the “import_id” field in the post, when calling wp_insert_post. This is treated as a “suggested” ID for the post that will be used if no post with that ID already exists. $post = array( ‘post_title’=>’whatever’, ‘post_content’=>’whatever’, ‘import_id’=>123 ); wp_insert_post($post);

URLs to images get messed up after migration

Back up your database (this is very very important) and download and install “Velvet Blues Update URLs” plugin. On the settings page enter in the old URL field http://subdomain.domain.com/subdomain.domain.com Enter in the new URL field the URL of your website. Select all options and click “Update”. Update your permalinks as well.

How to upload local changes to a live server without overriding new posts/pages?

Making content (database) changes on a staging environment is never recommended. You should only use a local/staging environment for template changes. Then, update your theme/plugins (the wp-content folder), and push those files to the live site. Once that’s completed, you can then populate the content. Database merging/synchronization is it’s own specialty/portion of the industry, and … Read more

Export and overwrite pages on import?

You have a narrow selection to choose from. Either replace the database tables with something like wp-cli or have a special import-export process for your data. If you want to make this granular, you could make a post metabox to import/export post content and metadata as json. Then updates could be incremental and on the … Read more

Change old URLs after the domain change

Two possible easy ways to replace Old website URL to New Website URL: 1/ Directly replace in SQL file: Export the database and open SQL file. Manually find and replace old website URL with new website URL. Once replace is done, save and import database again. 2/ Use Migrate DB plugin: Use the third-party WordPress … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)