Skip to content

Instantly share code, notes, and snippets.

@humayunahmed8
Created November 8, 2023 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humayunahmed8/155bf0e7e8b3e79cfcc27b77f4bdd52a to your computer and use it in GitHub Desktop.
Save humayunahmed8/155bf0e7e8b3e79cfcc27b77f4bdd52a 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.
@humayunahmed8
Copy link
Author

Screenshot_174

@humayunahmed8
Copy link
Author

carbon

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