Migrating from local MAMP setup to live server

Permalink
Hi, I think I need a few pointers.
I searched online for how to migrate but there are a lot of these and many seem quite old pages, so I can't be sure I've got correct info for C5 v8.

Before developing I used cpanel on the live server to install C5 8.5.1. The live server has cpanel so it's nice and easy to access PHPMyAdmin etc. All CHMOD settings are correct.

Then I set up a local environment where I installed C5 and just worked on that. I am now ready to put the site live so that my client can view it. The only files I have changed are in the theme package folder.

I have uploaded the theme package to my clean live C5 installation and set up a new empty database on the server.

I then used PHPMyAdmin on my local site to export the database using the 'quick' method, and format:sql.

The file downloaded really quickly and is just called sql... no file extension or anything.
I then tried to import that file using cpanel PHPMyAdmin but I'm getting an error:

"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<!DOCTYPE HTML><html lang='en' dir='ltr'><head><meta charset="utf-8" /><meta nam' at line 1"

Can anyone tell me if I've exported in the wrong format or if I should start from scratch and delete what's on the live server?

Many thanks
Allison

AllisonFewtrell
 
AllisonFewtrell replied on at Permalink Reply
AllisonFewtrell
Further information on this...
I am comparing my local application/config/database.php with the corresponding file in my clean C5 install on the server and noticed this discrepancy:

Local:
'character_set' => 'utf8',
'collation' => 'utf8_unicode_ci',

Live
'character_set' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',

Is this the problem and how should I fix it?
JohntheFish replied on at Permalink Reply
JohntheFish
@mlocati posted how to fix database character sets and collation on slack a few weeks ago. It may still be there. Probably in the dev or general channels (but I am guessing on that).
AllisonFewtrell replied on at Permalink Reply
AllisonFewtrell
Ah, I don't go on Slack... I have a link for it though.

It's all up and running for now though - I needed to give the client a link today. I managed to get the database exported properly using Database Dumper and got the images showing up by replacing my application/files dir with my local one... probably not the best way to do things but at least the site is visible.

Here's a link if you want a peek:https://ts4se-health-resources.org.uk/conc8/...
lots of dummy content in there for now but you'll see the updated theme is all fine and dandy ;)
AllisonFewtrell replied on at Permalink Reply
AllisonFewtrell
Another update...
In desperation I bought Database Dumper from the marketplace and managed to properly export the database as a .sql file!

I wish I knew why PHPMyAdmin wouldn't do the export though :(

Had a few tries at modifying the database.php file before I got the correct combination of user and password but it seems to have worked. Hooray!

The only problem I have now is that the images don't seem to be showing up...
JohntheFish replied on at Permalink Reply
JohntheFish
For the images you will need to upload /application/files (but not the cache) - just the paths starting 1234/5679 etc. and the thumbnails. Files don't live in the database.
studio108 replied on at Permalink Reply
studio108
What I do to export the .sql file from phpMyAdmin is the following:

Under 'Export' choose

Custom - display all possible options

Then click: 'save output to file'
Scroll to the bottom of the window and click 'Go'

This will save the file in the downloads folder

It works for me!
AllisonFewtrell replied on at Permalink Reply
AllisonFewtrell
Hi, yeah I tried that but same result. Must be something to do with my PHP/SQL settings or summat.