You quickly get familiar with pushing your local master branch up to your origin remote repository: You can send up a “side” branch that isn’t the master to your remote repository just as easily: Note the extra -u which appears before origin. It is short for –set-upstream. Since you’re sending your branch up for the …
Monthly Archives: December 2022
why is my local wordpress redirecting to production
It’s rare to start a website from scratch. More often, a developer needs to install a local wordpress environment to work on an existing website. After setting up a virtual server on a local computer, and copying over the theme files and database, nearly everything is ready to test that the local setup works. At …
Continue reading “why is my local wordpress redirecting to production”
update urls in database after importing to local to solve redirection issues
Am setting up a local development environment for WordPress, using VVV vagrant. I already exported the original database from production and imported it in the local placeholder website. For single-site installs, just replace the “siteurl” value in the “wp-options” from http://www.liveproductionsite.com to http://localtestsite.test For multisite-installs, there are a few more hoops to jump through. Remember: …
Continue reading “update urls in database after importing to local to solve redirection issues”
Import database with MariaDB and command line
Databases are easy to import through phpMyAdmin, but this interface has limitations. It doesn’t deal well with large files, since a timeout cancels whatever is ongoing. For larger files, it’s better to go through command line. Here are the steps to get it done:
Exporting a huge SQL database
I had to copy over a wordpress database from production to my local server. Export seemed ok, about 400+ mB but there would be errors upon importing in my local. I kept getting the ERROR 1064 (42000) at line xxx: You have an error in your SQL syntax; check the manual that corresponds to your …
Show databases on vagrant server
To show which databases exist on a vagrant virtual server, do the following steps. This supposes you already have a vagrant server up and running, for example VVV. It will list all current databases, like those of wordpress installs. If you reprovision your vagrant, you should know that it will try to recreate the placeholder …
Find out the size of a database
This command lists the tables within an sql database by decreasing size: Paste it in the “SQL” tab in phpMyAdmin. It won’t modify the database, since all it does is select entries and displays them. Source: https://chemicloud.com/kb/article/determine-size-databases-tables-phpmyadmin/
Git fetch and git merge
After setting up an origin remote for your repository, you can pull the information in it down to your local computer. You can either do it in one step with git pull, or two with git fetch and then git merge. git fetch The following is what creates a commit to change the information in …
Change git remote origin
When you’re swapping out a placeholder wordpress site and database for an actual in-development site, you need to change the origin remote that your local folder refers to. Indeed, a good practice is to host your “reference” work on an outside repository, like github or gitlab. This means you must tell your local computer where …
Add a remote on git
Git lets you track and synchronize files between a local folder on your computer and another folder somewhere on a server. Usually, this faraway server folder is called a “remote” repository. In git conventions and traditions, this faraway reference remote is often called “origin”. Here is the command to add or reference this with git. …