Duplicating wordpress database for local environment using Laragon - wordpress

I'm trying to create a local development environment to test website changes out in. The web developers I'm working with have a gitlab repo of the website with auto DevOps where changes are pushed to the production/stage sever when commited.
I downloaded Laragon and was able to serve pages locally, then I cloned the gitlab repo into my root directory.
How do I get a copy of production website's database and then connect it to my local development environment with laragon? I tried to duplicate the database on production with WP all-in-one migration but there are read/write restrictions.
I was advised the following: "I would recommend copying the database onto your local MariaDB/MySQL server the Laragon provides. You'd need to get a dump of the database from the server using SSH command line tools and then you can use the phpMyAdmin interface provided by Laragon to upload the dump".
I wasn't able to SSH from the windows command line, but I could SSH into the server using Putty, however, how am I able to transfer the file to my local windows machine? If I'm logged into my server wouldn't the file just be placed somewhere in the file system of the remote machine, so I wouldn't be able to use it with Laragon.

If you are using Laragon Full, you have ssh/scp command in Laragon's Terminal. So you can get your-sql-dump from your remote server easily.
Here's how:
Open Laragon's Terminal:
Menu > Laragon > Terminal
Run this command:
scp user#your-remote-host:/path-to-your-sql-dump C:/laragon/tmp/your-sql-dump
Import your sql-dump to your local database:
mysql -u root -p your-database < C:\laragon\tmp\your-sql-dump
Reference: https://laragon.org/download/migrate-from-xampp.html
That's all.

Related

Recover Wordpress from unbootable Ubuntu box

After rebooting a Wordpress Dev machine (Ubuntu Desktop), does not boot at all.
I can ping the machine, but cannot access it using SSH. I recon the SSH Daemon doesn't start properly.
Is there a way of recovering the Wordpress site from a dead machine? I have access to the filesystem by attaching it to another machine.
Depend on your Linux architecture, but you can certainly copy the files for your Wordpress installation. Usually files are in /var/www/....
Additionnaly you need to backup your database, if you have no means to access it throught SSH, you cannot use the SQL dump capability. You can try recovering raw database files wich are usually under /var/lib/*sql (for PostGreSQL database this is /var/lib/pgsql or /var/lib/mysql for MySQL database).
Once your database is backuped you need to use the exact same SQL engine and copy the files to the new database folder (be extr cautious with files permissions).

Is it possible to access a windows network or local drive from a remote Jupyter Notebook server running on Linux?

I have a web address that brings me to a remote Jupyter Notebook (Linux) server that I access from my Windows machine but need access to data on a local drive.
I have tried ssh and changing the config file, as well as changing the directory command but keep getting no location found
You can use file upload widget from ipywidgets to interact with your local storage via browser client. More info in ipywidgets docs.
You need to upload and write to the server.

Using Apigility on a remote server

I have successfully installed Apigility to a remote CentOS server. It tell me to go to http://localhost:8888 to access the admin panel. This server does not have a GUI installed so I don't have the ability to remote in to use a web browser. Is there a workaround to access the Apigility interface remotely, possibly restricting access to my IP address? If not do I have to install it on my local machine and then deploy my work to the remote server?
You could add a .htaccess
file
to set a password on it
If you're deploying to AWS you should be able to configure your SecurityGroup to only allow request to your installation if you're trying to access it.
if you want to develop your application right now I would recommend to have a local installation in a docker container or so to perform your changes. If you're going live you shouldn't change anything in the admin surface either.
centOS server using terminal if i am right. The best way to do this with centOs server in terminal is to open port 8888 to the public and access the server from another system serverIP:8888 (using tools like firewalld in the centOs server. U will have to install firewalld) https://www.rootusers.com/how-to-open-a-port-in-centos-7-with-firewalld/

Where does vagrant (PuPHPet used ) store data when I install meteor?

I've used PuPHPet to set up a development environment and did "vagrant ssh" to get into the machine. After that I installed meteor via curl https://install.meteor.com/ | sh, which worked as expexcted. I thought it would install it to the sync folder I have set up but it doesn't seem to be there. Can I find the file structure of the virtualized machine on my Windows PC?
How does it work? If meteor tells me I can access my meteor app via localhost:3000 how do I access this on my Windows PC?
I'm not so familiar with vagrant and windows, but give this a try.
Login with vagrant ssh
Open terminal and type hostname --ip-address
Paste <yourip> localhost in your hosts file on your windows machine system32\drivers\etc\hosts
Now, all your localhost requests in your browser are send to your vagrant box. I'm not sure if Meteors standard port works with vagrant, so try something like meteor -p 2000 or meteor -p 8080
If you want something like myapp.dev in your browser, you have to use virtual hosts. I'm only familiar with apaches virtual host system, but meteor is using nodejs so i don't know, what would be the best practice here. :/

syncing local development branch with remote branch

How do people usually work with managing remote stuff with local stuff? Say I have an EC2 instance running ubuntu and my dev machine is an OS X. I have a symfony2 project in it. Do people usually work with files directly on the remote server on EC2? If yes how do they use a text editor such as sublime text on an EC2 box?
I cannot say how "people" work. But to me the best practice is following:
Remote:
Install mysql & php incl. all extensions are needed. (symfony-project/web/config.php)
You could use this tutorial: http://www.howtoforge.com/perfect-server-ubuntu-10.04-lucid-lynx-ispconfig-3
Create Database for your project on server
Clone your git repository on server and define WebHook URLs
Create the file on your server. <?php git pull ?>
You'll never work on remote directly from now on! (except installing vendors by ssh)
Local:
Install local webserver. I recommend http://php-osx.liip.ch/ But you can also use MAMP (don't like that).
Clone git repository in web folder
Define remote Database in symfony project
See changes local
Commit&Push will pull remote automatically

Resources