Skip to content

Instantly share code, notes, and snippets.

@giovanni-d
Last active June 30, 2024 17:16
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, follow the instructions below:

  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.
@Muhammad-9500
Copy link

Muhammad-9500 commented Feb 6, 2024

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();

This restored my site successfully, but the site is not reachable again. While it was in the first place. So I reset the website and restored again, but it still doesn't work. I cleared cache and cookies in the browser but to no avail. The error says :
"The page isn’t redirecting properly
An error occurred during a connection to hitechpharma.net.
This problem can sometimes be caused by disabling or refusing to accept cookies.". Help!!!

@vetka-nn
Copy link

OMG,thanks and love you guys so much. The following still works in January 26th, 2024. (YES 2024!!)

Thanks a lot! It still works at version 7.8.1, April 2024!

@waldir-xam
Copy link

There's no need to edit the plugin files. xxxderpy's simple JavaScript console solution still works in the latest version.

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();

*tried this on 3.82
just put on console, refresh and the apply the restoration, wait and done..
thank you

@joefclarin
Copy link

joefclarin commented Jun 24, 2024

There's no need to edit the plugin files. xxxderpy's simple JavaScript console solution still works in the latest version.

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();

Tried and working in version 7.46
Executed this on console as others suggested

@tanfwc
Copy link

tanfwc commented Jun 30, 2024

Still working on 7.83. Thanks for saving the day, just need to use this tool once as client only have this backup file done previously.

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