=== Transtrix – Site Migration, Import & Export ===
Contributors: aayushk777
Tags: import, export, migration, woocommerce, backup
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Migrate a whole WordPress site, or copy only the pages, trips and products you pick. Images, links and settings travel with them.

== Description ==

Transtrix gives you two ways to move a WordPress site.

**Entire site** packs the database, media uploads, themes and plugins into one file. Restore that file on a new host or a new domain, or keep it as a backup of the site you have now.

**Selected content** moves only the pages, posts, trips and products you pick, along with their images, categories and the links between them. The rest of the other site stays as it is.

You pick the mode at the top of the Export screen, one job at a time. Use Transtrix to:

* Move a site to a new host or a new domain.
* Keep a full backup in History and restore it if an update goes wrong.
* Push twelve new trips from staging to a live site that is taking bookings, and leave every booking on the live site where it is.
* Reuse a set of pages, products or tours on a second client site without rebuilding them by hand.
* Hand a customer a ready-made demo they can import in a few clicks.

= Migrate an entire site =

An Entire site package has four parts, and you can leave out any of them:

* **Database:** all content and settings. Transtrix leaves out temporary data and spam.
* **Media uploads:** everything in `wp-content/uploads`.
* **Themes:** the active theme, and its parent theme when it has one.
* **Plugins:** your installed plugins, so the new site has the same features.

1. **Switch Export to Entire site.** Untick any part you don't need.
2. **Check the size.** Click **Estimate size first** to see how big each part is and the total for the package.
3. **Build the package.** A progress screen counts the database tables and files as Transtrix packs them, with an estimate of the time left. You download one .zip file, and Transtrix keeps a copy in History.
4. **Restore it on the new site.** Upload the package on the Import screen, the same place you import content. Transtrix shows where the package came from: the site address, WordPress and PHP versions, and table prefix. Choose which parts to restore, then confirm.

When the new site lives on a different domain, Transtrix updates every link to the new address. That includes links saved inside theme and plugin settings, which a plain find-and-replace would break.

Before a restore changes anything, Transtrix checks the package against the site you are restoring to. It stops if the site runs an older PHP or WordPress version than the source, if one site is multisite and the other is not, or if the server lacks disk space. You see the reason and what to do about it. If the table prefix differs, Transtrix renames the tables as it restores them.

A restore replaces what is on the site, and you cannot undo it from History. Transtrix moves the old files aside instead of deleting them, so you can check the restored site before you remove them. To roll a site back, restore an earlier package.

= Migrate selected content =

1. **Choose what to move.** Transtrix lists the plugins it found on your site and how many items each one holds. Open one, and every content type starts ticked. Untick what you don't need, or open a type and pick single items.
2. **Build the package.** You download one .zip file.
3. **Upload it on the other site.** Choose what happens to items that already exist there: keep what is already on the site, replace it with the package version, or add everything as a copy.
4. **Check the preview.** Before it writes anything, Transtrix shows how many items are new, how many it will replace, and how many it will leave as they are. It also lists links that point to content missing from both sites, by item name.
5. **Import.** A progress screen shows each step as it runs. When it finishes, you get a report of what was added, updated, left as is, and anything that failed.
6. **Undo if you need to.** Every import saves a restore point. Open History and undo the import in one click.

**Supported content**

* **WordPress:** posts, pages and media, with their categories and tags.
* **WP Travel Engine:** trips with their packages, coupons, extra services and accommodations, plus the destinations, activities, trip types, difficulty levels and trip tags they use. Bookings, customers, payments and enquiries are ticked too, so untick them if you want only the trips. When you bring bookings, Transtrix recounts the seats sold for each trip on the new site.
* **WooCommerce:** products with their variations, images and attributes, plus coupons, categories, tags and shipping classes. Orders, refunds and customers can come too, or you can untick them. An imported order arrives as a record of a past sale: Transtrix charges no card, sends no email, leaves stock alone and keeps the original totals. It works with High-Performance Order Storage on or off.

Transtrix shows a content type only when the plugin behind it is active.

**What keeps your live site safe**

* **Preview before you import.** You see the counts first, while you can still back out.
* **One-click undo.** Transtrix keeps restore points for 30 days. You can change that in Settings.
* **No duplicate images.** When you import a second package that shares images with the first, Transtrix reuses the images it already brought in instead of uploading copies.
* **You decide what happens to matches.** Transtrix matches items by slug. For each import, keep the existing item (the default), replace it with the package version, or add a copy.
* **No links to the wrong page.** When an item links to content that exists on neither site, Transtrix removes that link instead of pointing it at an unrelated page. The report names each one.
* **Only the items in the package change.** An import leaves the orders, bookings and customers already on the site alone.
* **No surprise emails.** Transtrix blocks outgoing mail while an import runs.
* **Long jobs pick up where they stopped.** If a request times out, the next one continues from the last finished item.

= WP-CLI =

Every action on the admin screen also runs from the command line, with no request time limit.

    wp transtrix export --module=wp-core --post_type=post --limit=20
    wp transtrix import /path/to/posts.zip --dry-run
    wp transtrix import /path/to/posts.zip --conflict=update --user=admin
    wp transtrix rollback <job-id>
    wp transtrix full-export --layers=database,uploads
    wp transtrix full-restore /path/to/site.zip --dry-run

Run `wp help transtrix` for every option.

= Privacy =

Transtrix sends nothing to any outside server. It has no account, no tracking and no remote calls. Packages stay on your own server, in a protected folder inside `wp-content/uploads/`.

= Server note =

On Apache and IIS, Transtrix blocks direct access to the package folder for you. nginx ignores those rules, so add one to your server block:

    location ^~ /wp-content/uploads/transtrix/ {
        deny all;
    }

= For developers =

A plugin can teach Transtrix about its own content by hooking `transtrix_register_modules`. A module describes its post types, taxonomies and the meta keys that hold IDs. Transtrix handles export, import, ID remapping, media and undo.

= Source code =

The admin screen is built from the uncompiled source in `assets/admin/src/`, which ships with the plugin. To rebuild `dist/`, run `npm install` and then `npm run build` in the plugin folder.

`dist/admin.js` bundles these open-source libraries, listed in `package.json`: React Query (@tanstack/react-query), Emotion (@emotion/react, @emotion/styled), React Router (react-router-dom), React-Toastify (react-toastify) and Tippy.js (@tippyjs/react). All are MIT licensed.

== Installation ==

1. In your admin, go to **Plugins > Add New**, search for "Transtrix", then install and activate it. You can also upload the plugin folder to `/wp-content/plugins/transtrix/`.
2. Install Transtrix on both sites: the one you export from and the one you import into.
3. Open **Transtrix** in the admin menu.

Transtrix needs WordPress 6.6 or newer, PHP 7.4 or newer, and a writable `wp-content/uploads` folder.

== Frequently Asked Questions ==

= Do I need Transtrix on both sites? =

Yes. You build the package on the first site and import it on the second.

= Can Transtrix move my whole site? =

Yes. Switch the Export screen to **Entire site** to pack the database, uploads, themes and plugins into one file, then restore it on the new site. If you want only some content, use **Selected content** instead, and Transtrix moves only the items you pick.

= Can I undo a whole-site restore? =

Not from History. A restore replaces what is on the site, so build a package of the current site first. Transtrix also moves the old files aside instead of deleting them. To roll back, restore the earlier package.

= Will it work if my new site has a different domain? =

Yes. Transtrix updates links to the new address when it restores, including links saved inside theme and plugin settings.

= Will a selected-content import touch the orders, bookings or customers on my live site? =

No. Transtrix adds and updates only the items inside the package. It leaves every other record on the site alone.

= What happens when an item already exists on the other site? =

Transtrix matches items by slug and asks you before each import. **Keep what is already here** leaves your existing item untouched and adds only new items. **Replace with the package version** overwrites the existing item. **Add everything as a copy** overwrites nothing, but the item appears twice. You can set the default in Settings.

= Can I leave bookings, orders and customer data out? =

Yes. Every content type starts ticked, so untick Bookings, Customers, Payments and Enquiries in WP Travel Engine, or Orders and Customers in WooCommerce, before you build the package.

= Can I undo a selected-content import? =

Yes. Open **History**, find the import and choose **Undo this import**. Transtrix removes what it added and puts back what it changed. Restore points last 30 days by default.

= Do imported WooCommerce orders charge customers or send emails? =

No. Transtrix calls no payment gateway, blocks outgoing mail during the import, and does not reduce stock again.

= My export is large. Will it time out? =

Long jobs continue from where they stopped. For very large sites, lower **Maximum items in this package** (500 by default) and export in batches, or use WP-CLI, which has no request time limit.

= Who can use Transtrix? =

Administrators. In Settings you can also let editors move content. Only administrators can use **Entire site** mode, and on multisite only network administrators can.

= What happens to my packages when I delete the plugin? =

They stay, along with History and undo data, so deleting the plugin by mistake loses nothing. To remove them too, open **Settings** and turn on **Delete packages, reports and undo data** before you delete Transtrix. That also removes the old files a whole-site restore moved aside.

= Does Transtrix send my content anywhere? =

No. It makes no outside requests. Your packages stay on your server until you download them.

== Screenshots ==

1. Export selected content. Transtrix finds WordPress, WP Travel Engine and WooCommerce content on the site. Pick trips, coupons, enquiries and accommodations, untick bookings, customers and payments, and build one package.
2. Import that package on another site. Choose what happens to items that already exist, check the preview, and run the import. The report shows what was added, and you can undo the import from the same window.
3. Export the entire site. Choose the database, media uploads, themes and plugins, estimate the size, and pack the whole site into one file.
4. Restore the entire site. Upload the package, check where it came from, choose what to restore, and confirm.

== Changelog ==

= 0.1.0 - 22nd October 2026 =
* New Feature: Introduced full-site migration and backup for databases, uploads, themes, and plugins, with automatic link updates for the new domain.
* New Feature: Added selected-content migration for WordPress posts, pages, and media.
* New Feature: Added migration for WP Travel Engine trips and WooCommerce products, with the option to include bookings and orders.
* New Feature: Added content import previews, one-click undo, and image reuse to simplify imports.
* New Feature: Added WP-CLI commands for exporting and importing content, undoing imports, and exporting and restoring entire sites.


== Upgrade Notice ==

= 0.1.0 =
First release.
