Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup Check before doing a database search and replace #112

Open
widoz opened this issue Dec 20, 2017 · 0 comments
Open

Backup Check before doing a database search and replace #112

widoz opened this issue Dec 20, 2017 · 0 comments

Comments

@widoz
Copy link
Contributor

widoz commented Dec 20, 2017

Right know there isn't a mechanism or else that make a backup of the database before the string

The entry point is: https://github.com/inpsyde/search-and-replace/blob/master/inc/Page/SearchReplace.php#L132

There we make a backup in case user has selected Export SQL file with changes and save the replacement within the database Save changes to Database.

Now, I tested and we can use Inpsyde\SearchReplace\Database::db_backup to create the file within the temporary directory.

In this case the two operation are performed within the same http request and may take more time and in case of huge database may create problems. Probably need further test.

Btw, if we implements an ajax way to make the s/r we can make a backup within a directory like wp-content/sr/ and an additional tab within the backend to show a list of old backups.
Also, additional columns may be the search value and the replace one, just to give some context to the user.

Another solution could be adding a required checkbox the user need to flag in order to replace directly into the database that say "I made a backup".

This can be implement fast even if to me isn't the best solution.

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

No branches or pull requests

1 participant