[{"data":1,"prerenderedAt":149},["ShallowReactive",2],{"\u002Fblog\u002Fwordpress-database-replacing-the-easy-way":3,"related-\u002Fblog\u002Fwordpress-database-replacing-the-easy-way":107},{"id":4,"title":5,"author":6,"body":10,"categories":87,"cta":89,"date":90,"description":16,"excerpt":89,"extension":91,"image":92,"imageAlt":93,"meta":94,"navigation":95,"path":96,"readingTime":97,"seo":98,"stem":100,"tags":101,"__hash__":106},"blog\u002Fblog\u002Fwordpress-database-replacing-the-easy-way.md","WordPress Database replacing the easy way",{"name":7,"avatar":8,"description":9},"Perlat Kociaj","\u002Fimages\u002Fperlat.jpeg","Full Stack Web Developer",{"type":11,"value":12,"toc":84},"minimark",[13,17,20,56,73,76],[14,15,16],"p",{},"I published an NPM package a small cli tool which does the exporting and replacing the URL for a WordPress website piece of cake. You can export and replace within 10 seconds (depending the size of the database and how fast you type).",[14,18,19],{},"I started this as a project for personal use, but decided to make it as an NPM package and publicly accessible. We all know the ritual for WordPress development.",[21,22,23,55],"ul",{},[24,25,26,27,31,32,31,35,38,39,54],"li",{},"Develop local using docker containers- Use git commit, git push (or FTP upload for old school hardcore people) to deploy- open phpmyadmin, find the database,export the database- find the file in the downloads folder (find which one is the latest from ",[28,29,30],"code",{},"database (2).sql"," or ",[28,33,34],{},"database\n(3).sql",[28,36,37],{},"database (5).sql","because you deleted (4)",[21,40,41],{},[24,42,43,44],{},"replace the local url with the staging\u002Fproduction url you can do it by:",[45,46,51],"pre",{"className":47,"code":49,"language":50},[48],"language-text","  \u003Cli>using any text editor to search\u002Freplace the url or\n  - using a plugin to import and replace url in the database\n      \n          \u003Cli>Install the plugin\n          - Configure the plugin\n          - Run the search\u002Freplace and wait to finish\n          - Done Or do the following while you are in your project directory:\n      \n  \u003C\u002Fli>\n","text",[28,52,49],{"__ignoreMap":53},"","\n  ","- run `devild db:export` and follow the instructions to export your database in your current\n      directory\n  - run `devild db:replace` and follow the instructions to replace the url and create another\n      file to keep the original one.\n  - done ( ~10 seconds ⏳ )\n\n",[14,57,58,59,66,67,31,70],{},"This package is available at ",[60,61,65],"a",{"href":62,"rel":63},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@perlatsp\u002Fdevild",[64],"nofollow","NPM Registry"," where you can install it by running ",[28,68,69],{},"yarn global add @perlatsp\u002Fdevild",[28,71,72],{},"npm i -g @perlatsp\u002Fdevild",[74,75],"hr",{},[14,77,78,79,83],{},"Need help with WordPress migrations or ongoing ",[60,80,82],{"href":81},"\u002Fservices\u002Fwebsite-maintenance","website maintenance","? I offer full-service support for WordPress sites.",{"title":53,"searchDepth":85,"depth":85,"links":86},2,[],[88],"Project",null,"2019-03-14","md","\u002Fimages\u002Fblog\u002Fdemo.gif","WordPress database URL replacement CLI tool demo",{},true,"\u002Fblog\u002Fwordpress-database-replacing-the-easy-way",1,{"title":5,"description":99,"ogImage":92},"An NPM CLI tool that exports and replaces WordPress database URLs in seconds, making site migrations fast and painless.","blog\u002Fwordpress-database-replacing-the-easy-way",[102,103,104,105],"javascript","npm","side-project","WordPress","W5Y4LYzfhWHc6Xu7sf2Duvso9Dku-Q3IB_oUrSjVswg",[108,113,117,121,125,129,133,137,141,145],{"title":109,"path":110,"categories":111},"Do I Really Need HTTPS? What Happens If My Website Is Not Secure","\u002Fblog\u002Fdo-i-really-need-https",[112],"Article",{"title":114,"path":115,"categories":116},"How Much Should a Business Website Cost? What You Are Actually Paying For","\u002Fblog\u002Fhow-much-should-a-business-website-cost",[112],{"title":118,"path":119,"categories":120},"How Often Should I Update My Website? A Realistic Guide for Business Owners","\u002Fblog\u002Fhow-often-should-i-update-my-website",[112],{"title":122,"path":123,"categories":124},"What Is Website Hosting and Does It Really Matter? A Non-Technical Guide","\u002Fblog\u002Fwhat-is-website-hosting-and-does-it-matter",[112],{"title":126,"path":127,"categories":128},"Why Did My Website Get Hacked? Common Causes and What To Do Next","\u002Fblog\u002Fwhy-did-my-website-get-hacked",[112],{"title":130,"path":131,"categories":132},"Why Do Emails From My Website Go to Spam? What Business Owners Need to Check","\u002Fblog\u002Fwhy-do-emails-from-my-website-go-to-spam",[112],{"title":134,"path":135,"categories":136},"Why Does Google Not Show My Business Website? A Plain-English SEO Checklist","\u002Fblog\u002Fwhy-does-google-not-show-my-business-website",[112],{"title":138,"path":139,"categories":140},"Why Does My Contact Form Stop Working? Common Causes and Easy Fixes","\u002Fblog\u002Fwhy-does-my-contact-form-stop-working",[112],{"title":142,"path":143,"categories":144},"Why Does My Site Look Broken on Mobile? The Most Common Non-Technical Causes","\u002Fblog\u002Fwhy-does-my-site-look-broken-on-mobile",[112],{"title":146,"path":147,"categories":148},"Why Is My Website Slow? 7 Simple Things That Usually Cause It","\u002Fblog\u002Fwhy-is-my-website-slow-7-simple-things-that-usually-cause-it",[112],1777992044463]