Combining Multiple SQL Files

Have you ever attempted to migrate a WordPress website, and the only database backup available looked like this? Separate files for each table can be a pain to import manually. Thankfully it’s an easy problem to solve.

Screen Shot 2017-01-04 at 7.09.45 PM.png

Combine SQL Files from the Command Line

Open up Terminal (on the Mac) and change directories to the where the SQL files are located.

cd /Users/currentuser/Downloads/snapshot-2016_12_07-11_14pm-full-0qmez2jjwi/wp-content/backupbuddy_temp/0qmez2jjwi

Next, run the following command to read all of the SQL files and produce a single SQL file.

cat *.sql > ~/Desktop/single.sql