Login failed after cloning live wordpress site to local wampserver - authentication

This is what I did:
Copy all files in public_html to C:\wamp\www\mylocalsite.com
Export my database and rename all http://mylivesite.com to http://localhost/mylocalsite.com of exported .sql file using
notepad++
Change database name, database username and database password in wp-config.php to my new database name, username and password that I
created in my local phpmyadmin
All done with no error. When I try to login using mylivesite.com login data, but it failed with no error notification.
My question is there any easy solution for me so then I can login to my localsite admin dashboard successfully?

Export my database and rename all http://mylivesite.com to http://localhost/mylocalsite.com of exported .sql file using notepad++
This is corrupting your database because several content is serialised and must be unserialized first before doing changes there.
Use a plugin like "WP migrate db" to search and replace the strings.
https://wordpress.org/plugins/search.php?type=term&q=migrate+db
If its ok to have you staging and testing site on the same server where the live site is located than you could also give WP Staging a try:
https://wordpress.org/plugins/wp-staging/

Related

Backup and restoration of Mautic

I am a beginner in IT and Web Development.
I would like to create a backup of the Mautic installed on a hosting server “A” and restore it in another server “B”. How do I do that?
If it’s possible to automate the backup and the restoration, please tell me how to proceed.
Do the Following to Back up and Restore your Mautic.
Zip you Current Directory then Download
Export your Maultic Database
on Server B
Creat Db
Import your Current Db
Upload Mautic Files to the domain folder you wanna use.
change Db Connection in app/config/local.php
These should fix the ish.

Dumping postgresql databases and accessing them via ftp

I'm developing an automated backup system for a server using PostgreSQL and Tomcat. The environment is CentOS minimal 7. Long story short, a VM will download the .sql dumps and a .tar.gz folder containing Tomcat via FTP.
No problems in setting up vsftpd, I can access the Server via FTP with a custom user (ftpuser) which currently can access a specific folder (/home/ftpuser/backups/). I can compress tomcat there so my script will fetch the backups/ folder and download it, but I cant figure out how to dump the postgresql db to the /home/ftpuser/backups/ folder without having to do some stupid things with sudo.
Postgres user haven't the permission to write there and i can't give them to him even with chown or chmod. I inserted postgres in sudoers and if I dump the db and then I "sudo cp" it to that folder is okay, but in this way I cant use a script to do that, due to "sudo" asking password.
The question is.. Is there a way to enable "pg_dump" to write .sql dump to /home/ftpuser/backups/ folder?
Thanks for the replies.
pg_dump does not need to be run from the postgres user.
Run it from a user that can write to the desired folder, and pass the --username=database_user parameter to specify the desired database user. You'll probably need a .pgpass file for the password used by this user (unless it has been defined to be trusted on pg_hba.conf).

How can I get download .sql file from a website

I have been given an assignment to fix the bugs in a website.
They give me the username and password to access the file in the hosting.
I'm using FileZilla and got all the source but the database .sql file is nowhere to be found
Any idea where the .sql went and how do I get it from the website using FileZilla?
thanks
You have to dump your database to .sql file first. Only then you can download it.
Assuming MySQL, see How to dump mysql database?
If you have phpMyAdmin (or a similar tool) available, you can dump and download the .sql file at once from the web interface directly.

Save and access file from shared drive

I am running a file upload process to upload files to a db. The web server and the SQL server are different machines. I am attempting to use an SQL OPENROWSET to upload an excel file, but I cannot determine how to get the file onto the other machine. Is there a way to set up a shared drive that the web server can save a file to and the SQL server can access? We have a local network set up with Active Directory.
For Example:
WebServer - Shared drive on web server under C:/inetpub/webpage/fileImport
SQLServer - Will log in with sql auth using USERID and PASSWD. Needs to access webserver shared drive.
What user do I share the drive on web server with so that the sql auth user will be able to access it when I run the OPENROWSET?
Any help will be much appreciated.
I am also trying the same thing by uploading the file in FTP and trying to access it. But i didn't get any progress from last 2 weeks.
And i had found may other alternatives like coping the files in another server and share the folder with out user name & password. then we can able to access it by giving the
\\folder\filename
If u get any other alternative plz share...
You should setup a new user that has access to the user group iis_users, and then give them security access to the file drive itself.
The same should be done to the DB server, and on the drive folder security the other user will need read/write/Modify permissions.
So it will look like:
(WebHost) ---- (Shared) ---- (DBHost)
*-------*
Well, you would setup the folder on the SQLServer.
Create a secure user on the SQL machine.
Make the folder shared (with modify rights for the secure user)
Map the Network drive on the Windows machine, using the secure user to access it.
Your main user on the SQLServer should then be able to openrowset from the local folder, whilst the IIS Server is remotely accessing it.
Using the OPENROWSET means that SQL qill access files using the service account. This account must be used to access share drive, as stated here Using SQL Credential to Open a file with OpenRowSet.

Drupal production site access issues

I am unable to get access to my Drupal 7 website as I migrate it from my dev to prod servers.
The steps I followed are :
Take a SQL dump of the database
Upload Drupal site into the www/ folder available online
Create database on website with the same name
Import the SQL dump of the dev database and recreate the tables on the live database.
Make changes to settings.php as applies
Now I am not sure what changes to settings.php as applies indicates. However, when I try and access my site at say examplesite.com , I am shown SQLSTATE[280000] Access denied for user 'siteadmin#localhost' using password: YES
siteadmin#localhost is the same guy who acts as administrator on my development website and has the same password.
SO I am not sure why the same login credentials do not work for my dev site.
I also tried the credentials I have to access the control panel of my website but they do not seem to work either
Am I missing a trick here guys?
Thanks!
Recheck your settings.php twice
If correct, check if you can have a direct access your database with these credentials (via command line or phpmyadmin for example)