Skip to content

Instantly share code, notes, and snippets.

@giovanni-d
Last active June 16, 2025 08:04
Show Gist options
  • Save giovanni-d/f9a05638e0b31467762b71585e8c3bfa to your computer and use it in GitHub Desktop.
Save giovanni-d/f9a05638e0b31467762b71585e8c3bfa to your computer and use it in GitHub Desktop.
All-in-One WP Migration - Restore From Server (without PRO version) - Restore

All-in-One WP Migration Restore From Server (without pro version)

If you don't want to pay for the PRO version of this plugin, and you want to use the "Restore from Server" functionally that was present in the version 6.77, open your browser’s dev tools and run the code below in the console:

Last confirmed working: May 2025 on version 7.94

var filename = 'FILENAME.wpress';
var importer = new Ai1wm.Import();
var storage = Ai1wm.Util.random(12);
var options = Ai1wm.Util.form('#ai1wm-backups-form')
.concat({name: 'storage', value: storage})
.concat({name: 'archive', value: filename});
importer.setParams(options);
importer.start();

Note: Replace FILENAME.wpress with the string from the data-archive attribute of the restore button next to the file.

To make this change survive a page reload, you must edit the plugin files (warning: plugin updates will remove your edits):

  1. Open the js file: wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/backups.min.js
  2. On line 1208, replace the code below:
$('.ai1wm-backup-restore').click(function (e) {
  e.preventDefault();

  if (!!Ai1wm.MultisiteExtensionRestore) {
    var restore = new Ai1wm.MultisiteExtensionRestore($(this).data('archive'));
  } else if (!!Ai1wm.UnlimitedExtensionRestore) {
    var restore = new Ai1wm.UnlimitedExtensionRestore($(this).data('archive'));
  } else if (!!Ai1wm.FreeExtensionRestore) {
    var restore = new Ai1wm.FreeExtensionRestore($(this).data('archive'));
  } else {
    var restore = new Ai1wm.Restore($(this).data('archive'));
  }
});

with the following code:

$('#ai1wm-backups-list').on('click', '.ai1wm-backup-restore', function (e) {
  e.preventDefault();
  var modelimport = new Import();

  var storage = Ai1wm.Util.random(12);
  var options = Ai1wm.Util.form('#ai1wm-backups-form')
    .concat({ name: 'storage', value: storage })
    .concat({ name: 'archive', value: $(this).data('archive') });

  // Set global params
  modelimport.setParams(options);

  // Start import
  modelimport.start();
});
  1. Go to your All-in-One WP Migration > Backups page and you should be able to use the Restore button now.
@tanveeratlogicx
Copy link

@XX

@xxxdepy

var filename = 'FILENAME.wpress';
var importer = new Ai1wm.Import();
var storage = Ai1wm.Util.random(12);
var options = Ai1wm.Util.form('#ai1wm-backups-form').concat({name: 'storage', value: storage}).concat({name: 'archive', value: filename});
importer.setParams(options);
importer.start();

The solution worked like a charm! Saved so much of my time.

I just tried it on Version 7.91 and to my Surprise this still worked! Great Job.

@modeitsch
Copy link

Tanks! @xxxdepy !! still working in 03/04/2025

@vinhdatgn
Copy link

image Sadly I'm keep having the 500 internal server error at restoring database step. No matter what method I do, edit backup file or console code. I even tried old version of the plugin which used to work really well for me :(

@Pikamander2
Copy link

@vinhdatgn - The plugin version is unrelated. You would need to check your error logs to see what's causing the 500 error.

90% of the time, it's due to a PHP version issue, like an old plugin not being updated to support PHP 8.

Change your new site's PHP version to match the old site, or disable whichever plugin is throwing the error.

@vinhdatgn
Copy link

image Does anyone facing this "Importing this file will only replace matching content. Other items stay unchanged. Need a full reset first? Try Reset Hub in our [Unlimited Extension]. Ensure you have a current backup. Proceed?"

I can not restore anymore from newest version

@ND246
Copy link

ND246 commented May 21, 2025

To reiterate, there's no need to edit any plugin files. A simple console command on the Backups page is all you need.

var filename = 'FILENAME.wpress';
var importer = new Ai1wm.Import();
var storage = Ai1wm.Util.random(12);
var options = Ai1wm.Util.form('#ai1wm-backups-form').concat({name: 'storage', value: storage}).concat({name: 'archive', value: filename});
importer.setParams(options);
importer.start();

Good to go on Version 7.94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment