=== Overl1te Migration SQL ===
Contributors: overl1te
Tags: migration, database, sql, search-replace, import
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.1
License: MIT
License URI: https://opensource.org/licenses/MIT

Generate SQL for WordPress migrations: dump tables with data, replace local URLs, and finish production dumps.

== Description ==

Overl1te Migration SQL helps you move a WordPress site between environments by generating SQL you run yourself. It does not change the live database until you (or your DBA) execute the generated statements.

The plugin is intended for administrators who already make database backups and understand SQL. Typical uses:

* Export table structure and optional INSERT data, with the new domain substituted in text values.
* Generate UPDATE … REPLACE statements for selected tables when only URLs need to change.
* Preview how many rows would match (dry run) before you generate replacement SQL.
* Upload a production `.sql` dump, detect its prefix and domain, and generate a finish patch (URL replace, prefix rename, missing columns).
* Copy ready-made WP-CLI `search-replace` commands, which are safer for serialized data.

= What it does not do =

* It does not execute migration SQL against production for you.
* It does not upload dumps to a remote host or phone home.
* It does not rewrite post GUIDs (by design).
* Plain SQL REPLACE can break PHP serialized strings. Use WP-CLI for those leftovers.

= Safety =

Only users with the `manage_options` capability can open the plugin. All form actions use WordPress nonces. Uploaded dumps are read from the temporary upload file and are not stored in the media library. Always take a full database backup before running generated SQL.

= Privacy =

The plugin stores a short generation history in a WordPress option on the site where it is installed. History and SQL transients are removed when you uninstall the plugin. No data is sent to third parties.

== Installation ==

1. Upload the `overl1te-migration-sql` folder to the `/wp-content/plugins/` directory, or install the zip via Plugins → Add New → Upload Plugin.
1. Activate the plugin through the Plugins screen.
1. Open **Migration SQL** in the admin menu.
1. Generate SQL, download the `.sql` file, and run it on the target database after a backup.

== Frequently Asked Questions ==

= Does this plugin modify my database? =

No. It generates SQL (and WP-CLI commands) for you to review and run. The dry-run action only counts matching rows.

= Will serialized data stay valid? =

SQL `REPLACE()` does not update serialized string lengths. After a domain change, run WP-CLI `search-replace` for remaining serialized values. The plugin prints those commands on its admin page.

= Does it support WordPress multisite? =

Yes. On a network it can include tables for all sites (blog prefixes plus shared tables such as usermeta).

= Why are post GUIDs left unchanged? =

WordPress uses `guid` as a unique identifier, not as a public permalink. Changing it is usually unnecessary and can confuse feed readers.

= What should I do after importing SQL? =

Visit Settings → Permalinks and click Save. Then verify `siteurl` / `home` and log in on the target site.

= Can I restore a previous SQL generation? =

The plugin keeps the last five generations. Structure dumps with INSERT data store only a preview in history; download the full SQL while it is still on the page.

== Changelog ==

= 1.3.1 =
* Rename the plugin to Overl1te Migration SQL to follow WordPress.org naming guidelines.
* Update Tested up to WordPress 7.1.

= 1.3.0 =
* Prepare the plugin for the WordPress.org directory: English UI, readme.txt, uninstall cleanup, and enqueued assets.
* Switch the license to MIT.

= 1.2.0 =
* Add production-dump analysis, dry run, generation history, SQL download, and WP-CLI helpers.

= 1.0.0 =
* Initial release: table structure SQL and domain replacement SQL.

== Upgrade Notice ==

= 1.3.1 =
Display name and text domain updated to Overl1te Migration SQL.

= 1.3.0 =
Admin UI strings are now in English and translatable. Uninstall removes stored history.
