admin管理员组文章数量:1287524
I have a wp db dump file inside my site directory. Can someone show me an example of how to use wp-cli search and replace command on the static sql file, not the active db to change my url from "old-example" to "new-example"
/var/www/html/wp-site/dumps/oldexample/dumpeddb.sql
/var/www/html/wp-site/dumps/newexample/ready-for-import.sql
Not quite sure how to apply this to already exported db dump.
$wp search-replace foo bar --export=database.sql
I have a wp db dump file inside my site directory. Can someone show me an example of how to use wp-cli search and replace command on the static sql file, not the active db to change my url from "old-example" to "new-example"
/var/www/html/wp-site/dumps/oldexample/dumpeddb.sql
/var/www/html/wp-site/dumps/newexample/ready-for-import.sql
Not quite sure how to apply this to already exported db dump.
$wp search-replace foo bar --export=database.sql
1 Answer
Reset to default 1This is not possible, WP CLI uses SQL queries to acquire and update information. You would need to import the SQL file into a database to perform a search replace with WP CLI.
本文标签: customizationApplying WPcli Search amp Replace to Static SQL Dump File
版权声明:本文标题:customization - Applying WP-cli Search & Replace to Static SQL Dump File 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741257671a2366998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
wp search-replace
will only work to the current database which is configured inwp-config.php
– Den Isahac Commented Oct 21, 2021 at 22:40