Transferring files to and from separate computers

I am currently following along with a course on Udemy learning how to program. (doesn’t really matter) I work on the local website that I have setup in two different locations. The first location is at home on my Desktop. The second location is at work on my laptop. I’m trying to figure out a way to transfer the files for my website to and from each device. I have tried exporting and importing. That worked for the initial setup, but after that it doesn’t transfer over the Pages, Posts, or virtually anything that you create within the Wordpress Dashboard. I’m assuming, those files would be located in the Database… But I’m unsure where the Database files are and I’m even more unsure if these files would even be IN the Database. I currently don’t want to pay for the Pro package for something I could spend a little extra time doing myself. I just need to be pointed in the right direction for transferring the files.

My current routine is the following:

(Vice versa from desktop to laptop, depends which one I begin on, of course.)

On my laptop –
Users\username\Local Sites\ I zip the entire website file.
I then add that zip file to a flash drive.
Then I extract the file from the flash drive onto my Desktops file location : Users\username\Local Sites
Replacing all the files. Doing this, it carries over everything expect the Pages, Posts, etc. of the Wordpress Website. (apologies if this is redundant and if it’s already been answered elsewhere.) Thanks in advance!

Hey there @Itchito!

The process that you’ve outlined only moves the files. You are absolutely right that the pages/posts are stored in the database. In order to get those in sync, you’ll need to get a copy of the database as well. The best way to do that is going to be using the Export option in Local:

When you have the zip file that Local creates, you can put that on your flash drive and then drag-and-drop it into Local on your other device. This will create a new site with the files/database in the zip. This will contain the database as well as the files, so you’ll have your pages and posts!

Thank you for the quick reply! This method did work the first time I wanted to share the files from my Desktop to my Laptop, but since I’ve modified code, and created new pages and posts, the files that I transferred back to my desktop don’t include the pages or posts. I could be doing it wrong, I will give it another few tries.

As long as you are creating a new site when you import the archive, it should contain the new pages/posts. I wonder if there’s something else going on.

Can you please provide your local-by-flywheel.log file? See this Community Forum post for instructions on how to do so:

Hi Matt, thanks for this info. In the event you are not creating a new site and are working with an existing site, how would you update it then?

Great question!

It’s a bit more manual process but if you’re trying to update an existing site, you’ll want to work with this a bit differently. In this premise, we assume you have an export from Local with the /app/ folder that contains /public/ (site files) and /sql/ (database) the respective site files.

  • Navigate to your existing Local site’s working folders and replace the content of its /public/ folder with the contents of the /public/ folder in the archive.
  • Use Adminer (or whatever database utility you prefer) to drop the existing tables in the Local site and import the local.sql file.

If the site is using the same local domain in both environments, you won’t need to make any adjustments but if you are using different domains, you will need to update the database with a search-replace.

2 Likes

That is the problem I’m having. I’m not trying to create an entirely new site every time I want to share the files back and forth. I just want to essentially update the already existing files with any changes I may have made on the alternate device

You could also use a migration utility like Updraft/All-in-one-Migration to assist in the “sync” process.

1 Like

Thank you @mattwhosthat! I didn’t see your reply about importing the local.sql file. I believe this will work for me, I’ll test it out!

2 Likes