NethServer Version: 7.4
I’ve mentioned a few times that I’m looking into migrating from SME 9.2 to Neth 7.4. One of the things that will need to be migrated is a Nextcloud installation, and I have the bulk of the procedure worked out. But it involves doing a good bit of find/replace through the old database, and doing it manually would be both tedious and error-prone. The are several tables in which the operation needs to be run, and there will be several iterations of the replace to run (each UUID needs to be replaced). Which leads to two questions:
- Is it possible, using phpMyAdmin, to run a find/replace through an entire database rather than one table at a time? Bonus points if it will show the tables in which replacements were made. Failing that, is it possible to do it at the mySQL/mariaDB shell?
- Is it possible to automate doing several such find/replace operations? IOW, throughout database
owncloud, in all tables, replace
newval1, then replace
Edit 2: The script from interconnect/it looks like it will do quite well for the first bullet. It will also do a dry run to let you know what, if any, changes will be made, as well as show the tables affected once it completes. Since that script can also be called from the command line, it would no doubt be possible to combine that with another script and an input file containing the appropriate data. One of the comments on the blog post I linked links to a page from w8.se which apparently (as of 2009) had a version of the script that would satisfy my second bullet point as well, but it isn’t there any more.