How to unzip the folder on live server

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
I assume FTP has no ability to unzip?

Do you guys keep Cpanel open when you use FileZilla?

Trying to find a balance here, FTP seemed so beautiful, but logging into Cpanel each time is a las.
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
And now with the wordpress theme development I will be deploying wordpress from the local machine via FTP as well, will be a b i t c h if I have to open up 40 odd cpanels
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236

I don't trust this.

I use phpmyadmin and ftp

It's the safest way and I understand it by heart.

Just the schlep of logging into Cpanel the whole time to unzip after each upload


Now this is interesting!, thanks for this!!!!

And, I haven't used it yet but it I've read something about it that looks promising: https://wordpress.org/plugins/tailor/
It's also free and open source: https://github.com/andrew-worsfold/tailor

Spend some time working on that instead of developing your own cms :)

Not interested. I prefer to build it my own way ie not the drag and drop method.
 

rward

Senior Member
Joined
Oct 26, 2007
Messages
865
I don't trust this.

I use phpmyadmin and ftp

It's the safest way and I understand it by heart.

Just the schlep of logging into Cpanel the whole time to unzip after each upload

Bear with me, this is worth the read...

I'm unsure what your development process is but mine goes something like:
- create the website on my local machine using xxx.local
- move to a staging site for the client to review xxx.yyy.com
- move to production site xxx.com

Just dumping and restoing your database is not safe and is not going to work, here's why:

Attachment metadata and some plugins (Almost every slider I've used) store data in a serialised string like:

a:5:{s:4:"name";i:1211;s:25:"http://xxx.local/some_url";.....}... (check your wp_postmeta table for examples)

What this means is
a:5 - array of 5 items (I'm only showing 1)
s:4:"name" - expect a strng of 4 characters -> the word "name"
s:25:"http://xxx.local/some_url" - expect a string of 25 characters -> the string "http://xxx.local/some_url"

Multiple issues:

If you go use phpmyadmin to dump your local dba nd import it to staging then all your links are going to be refering to your local/dev domain name and not your staging domain (so you'll be serving files from dev, not staging).

If you do a straight sql string update to change xxx.local to xxx.yyy.com then your data is going to be looking like:

a:5:{s:4:"name";i:1211;s:25:"http://xxx.yyy.com/some_url";.....}...

Looking at that second record we now have:
s:25:"http://xxx.yyy.com/some_url"

Except the string, http://xxx.yyy.com/some_url, is 29 characters long and not 25 so something is going to go wrong.

This can be very annoying when your plugin settings are stored in this manner, you upload your new database and the setting are all incorrect as the serialisation isn't being read correctly.


What the plugin I recommended does is take care of all of that for you.
It allows you to change your domain name on export so when you import to a new/staging/live site you don't have any of these issues.

Plus you can elect to only export your theme, just the db, only the media, or all of everything.


At the very least look into using:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Some toilet reading: https://codex.wordpress.org/Moving_WordPress



Not interested. I prefer to build it my own way ie not the drag and drop method.

Yeah - it's not meant for you to create pages in, it's for when you need to hand the site over to clients, then they have a nice and easy way to create content for themselves :)
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
Why not unzip before hand and then FTP across?

Ask Web Africa that question. 40Mbps line and I can barely use it.

So I try all the nitty gritty ways to make uploading easier zipping seemed logical trust me if I could get fiber i would delete winrar
 

Necropolis

Executive Member
Joined
Feb 26, 2007
Messages
8,401
Go with a host that provides you SSH access.

then:

1) scp your zip file to the server

2) ssh in a unzip.

:)
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
Bear with me, this is worth the read...

I'm unsure what your development process is but mine goes something like:
- create the website on my local machine using xxx.local
- move to a staging site for the client to review xxx.yyy.com
- move to production site xxx.com

Just dumping and restoing your database is not safe and is not going to work, here's why:

Attachment metadata and some plugins (Almost every slider I've used) store data in a serialised string like:

a:5:{s:4:"name";i:1211;s:25:"http://xxx.local/some_url";.....}... (check your wp_postmeta table for examples)

What this means is
a:5 - array of 5 items (I'm only showing 1)
s:4:"name" - expect a strng of 4 characters -> the word "name"
s:25:"http://xxx.local/some_url" - expect a string of 25 characters -> the string "http://xxx.local/some_url"

....
Snippels (just to make my post a bit smaller)

I hear you, learned that when I did the first dump.

This is how I do it now ( This is only wordpress other platforms/framworks I do differently depending on the process needed.)

Right, Essentially, the process entails downloading the database file from the local installation, editing it for the correct paths before importing it to a new database on the server, and finally uploading all contents of the local WordPress installation.

Step 1: Export Database File
http://localhost/phpmyadmin

I select the database I click export I leave it as quick and SQL and I click go.

Step 2: Modify File Paths

I open up the database in Atom and I fix the file paths (Find and Replace)

To do this I simple find http://localhost/my_test” and replace it with “http://www.mydomain.com/subfolder"

Step 3: Create New Database on Your Hosting Account

Either PHPmyAdmin or MySQL Databases depending on the host at hand.

Step 4: Upload Database File into New Database

If your host doesn’t have phpMyAdmin, use the Database Restore option in MySQL Databases. It does the same thing—allows you to browse and select a .sql file.

Step 5: Fix wp-config.php File

Edit this:

define(‘DB_NAME’, ‘your_database_name’);
define(‘DB_USER’, ‘your_database_user’);
define(‘DB_PASSWORD’, ‘your_database_password’);
define(‘DB_HOST’, ‘localhost’);

Step 6: Uploading Website Files

This is where FTP comes in and I zip it before hand to speed up the transfer process ( upload speed )

Step 6: Unzip in Cpanel

Unzip

Step 7: Modify Permalinks

I login in /wp-admin
And make sure the permalink structure is the same as it was in my local environment

By going Settings > Permalinks

Success
 

rward

Senior Member
Joined
Oct 26, 2007
Messages
865
Step 2: Modify File Paths

I open up the database in Atom and I fix the file paths (Find and Replace)

To do this I simple find http://localhost/my_test” and replace it with “http://www.mydomain.com/subfolder"

If you don't do that correcctly and update all the serialised string lengths then you're going to get caught out at some point

If you do a straight sql string update to change xxx.local to xxx.yyy.com then your data is going to be looking like:

a:5:{s:4:"name";i:1211;s:25:"http://xxx.yyy.com/some_url";.....}...

Looking at that second record we now have:
s:25:"http://xxx.yyy.com/some_url"

Except the string, http://xxx.yyy.com/some_url, is 29 characters long and not 25 so something is going to go wrong.
 
Top