Ho to configure WordPress with GitLab - wordpress

I'm pretty new to this, but I want to configure my GitLab repo to my Cpanel hosting account. So when I push changes from my local site (environment using local by flywheel) to GitLab it automatically goes to the staging site and if everything is good to the production site.
I have managed to connect my Cpanel account with GitLab by using Deploy HQ. However, I'm trying to understand the best way to set all of this up. Currently, I'm only tracking my themes folder in GitLab. My issue is that when I deploy, all that is getting uploaded is the themes folder(obviously). How do I set this up so it will upload the full WordPress site and database? Also, how do I set it up with staging and production, would I have two different branches connected to two different directories on cpanel?
I'm just looking for some noob friendly advice on how to set up this infrastructure for WordPress Git and Cpanel.

Related

Cpanel alternative for WordPress on AWS lightsail?

I hired a developer to stand up my website. I had already created a WordPress install on AWS lightsail. The developer says he needs cpanel in order to finish the work (header/footer code, configuration etc...). I was hoping to do this as cheaply as possible and it seems like cpanel would add $15 a month. Is it really needed? Any alternatives?
Looked at AWS docs on alternatives but didn't find anything.
cPanel is a hosting control panel to manage a website and server. It seems that you have already hosted and configured your server without cPanel. For developers, they should be able to manage and customize your website using FTP and WordPress admin details and it does not require from Development point of view.
Even if you are planning to add cPanel to your server, you will have to reinstall your server from scratch because cPanel requires a fresh server without any software, data or website.

Setup for Wordpress + Plesk + Git + Local Environment

I need to update a development environment which exists for multiple Wordpress sites (existing and new ones) and which uses Plesk. Now Git should be used for version control.
Right now every change is done on the stage system, which is not good.
Description of the situation:
Themes which will be used are completely self developed and therefore Git should be used as version control.
The management of the sites is done with Plesk (Production and Stage version).
Sometimes (depending on the site owner) the most recent content is on the production site and sometimes on the stage site (site owner is updating content there) and must be transfered to production.
With the introduction of Git a local environment for every developers is needed (to locally develop and then push the changes to Git), to setup different sites from Plesk on a local environment I would choose MAMP?
Plesk offers a connection between Git (Gitlab in our case) and Plesk so commits will be automatically fetched by Plesk's Stage and Production environments and are published depending on the settings.
So the Workflow (and included questions) may be the following:
Setup new site on Plesk and download fresh stage state to local MAMP.
Create a repository on Gitlab and connect stage branch to Plesk stage site and main branch to Plesk production site.
Local Git folder will be the wordpress folder. Gitignore will ignore everything except the theme folder and the plugin folder (only plugins which have custom changes)
Working locally on stage branch and commiting will result in automatically updating the stage system on plesk.
The production page will not be updated automatically, this has to be done manually because this scenario varies from site to site.
Problems:
Migrating stuff to the production site will be only possible with a manual task I guess, because there is no possibility for customising the pipeline on gitlab as far as I know?
Don't know what to do with content images. Should they be ignored in the Git repo? Currently I would say yes if it's not template related?
Does this sound as a proper way or do I oversee some obstacles here or is there something which can be done in an easier way like the local setup for a new developer on an existing site. As there is only part of the Wordpress stuff in Git, the database and the rest of wordpress have to be copied from somewhere (e.g Plesk' Stage site).
In general the dev setup, deployment and version control with wordpress sites seems a little bit odd for me compared to others like webapps, mobile apps or backend services.
I've used git as version control for the whole WP installation and individual themes/plugins. Under normal circumstances, I don't see the point for the first option, unless you want to keep all the plugins and WP version in sync with the git repo. In that case, you should definitely gitingore the upload folder, otherwise uploading any attachment will cause a mess.
The automate the deploy, you can configure a webhook:
https://conetix.com.au/support/automatic-git-deployments-via-gitlab-to-plesk-based-hosting/

How to run a wordpress.com hosted website locally using docker?

Currently we have a WooCommerce webshop hosted on wordpress.com. This webshop was setup as a prototype and because of its succes we want to start developing the webshop further. We don't want to change the production website directly, but we want to develop inside a closed development environment (e.g. locally using docker).
I have tried to run the webshop locally by exporting all its data using the All-in-One WP Migration plugin. Afterwards I have created a docker environment with a wordpress and a mysql container. On the wordpress container I've also installed the All-in-One WP Migration plugin and I've imported all the data. It looked like this worked fine, but after a few clicks I saw that I could not navigate to any other URL besides the homepage. I have read online that the Wordpress codebase being used on wordpress.com differs from the default codebase which can be download on wordpress.org. So I think this means the wordpress.com export file can't be imported into a default wordpress container.
Because of this I've tried to download all the files on wordpress.com using FTP and run the website myself using a php container. This also didn't work, because I can't download all the files using FTP because of the permissions. I also contacted the support of wordpress.com, and they told me they couldn't sent me the contents of these files. But without these files, I don't know how I can run the wordpress.com website locally.
I hope someone can help me with getting the wordpress.com website to run locally in a development environment. A suggestion how we can implement a workflow where we can change the webshop in a development environment and deploy the changes to our production website is also very welcome.
Edit: For now I've chosen to run my site in a docker environment and write down all the changes I make locally. When I'm satisfied with the site locally, I will repeat the changes I made earlier on the production website. I've chosen this workflow because I don't really know the structures inside Wordpress. I don't know how I can migrate the files and database tables I need to switch theme, without overwriting the database tables I want to keep (e.g. WooCommerce orders table).
Have you tried running it on a localhost? MAMP is a good option for this.
https://www.mamp.info/en/

Developing on plesk

Trying to figure the best way to develop on plesk.
I would like to develop my wordpress website on a temporary url, and attach the production domain only when I am done developing.
From some reason I'm getting various dns errors, saw a guide referring to change of hosts file but it dosent seem like the perfect solution to me.
Any tips?
You may create the clone of your WP instance (staging) and use Plesk Git extension for developing this staging WP site. After making all necessary changes on staging non-public clone you can publish it to a production domain to make it publicly available.

How to migrate ghost blog on local machine to digital ocean web server?

I am following this tutorial here (How To Host Ghost with Nginx on DigitalOcean) but I am stuck on the step to copy my local files over to my Digital Ocean web server. I am pretty confused as to whether or not I have to FTP or something, or whether I have to create another droplet/VPS and install ghost on there, and then copy everything from my local machine to the new VPS instance.
Ideally, I would like to just be able to edit my local blog and deploy straight from there, but it seems very difficult.
update: this imported my posts, but not the theme I installed or the images. I guess you could reinstall the theme at digitalocean and ssh the images any custom css you did to the theme?
On your Mac go to127.0.0.1:2368/ghost/debug and export. Then go to the your Digital Ocean ipaddress/ghost/debug and import.
https://ghost.org/forum/installation/3067-migrating-from-a-local-ghost-blog-on-mac-to-digital-ocean/
original post:
Copying the contents folder from local to digital ocean did not work for me. I copied my entire contents folder from local to digitalocean and renamed the existing digitalocean content folder. This breaks the blog. I am searching now for a migration how to. I will update this if I find the answer.
This information should help you:
How To Use SSH Keys with PuTTY on DigitalOcean Droplets
How To
Use Filezilla to Transfer and Manage Files Securely on your VPS

Resources