Replace string across all tables, rows, indicies in SQLITE

I have a .sqlite file in a local folder. I would like to update all URLs in this SQLITE file across all tables, indicies, and rows.

What is the best way to do this?

In a regular sql file I was able to just do this using text editor replace function or to enter a command in phpmyadmin to do the same. Any similar method I can use for a .sqlite?

I tried using a hex editor and that broke the site. I tried using the SELECT replace(‘http://old.url’,’old.url’,’new.url’); function using DB Browser for SQLite application but it doesn’t update anything.

Personally I would first use the backup you have to get the data with old URLs. Then you could use a tool such as the WP CLIs search-replace command to replace the URLs in the db.

Example use case of aforementioned search-replace command:

wp search-replace 'http://old.url' 'http://new.url'

Instead of manually update, its better to use plugin so plugin will replace string all tables. “Better Search Replace” this plugin is good for replace string in whole database.

For safety purpose you should take backup first of existing database.

Leave a Comment