After trying several methods, I had to ask here.
So recently I was working on a site of my own which was developing on my desktop locally (using xampp), but now I want to work on the same website (locally) from my laptop (ubuntu 16.04), so I installed xampp (lampp) on my laptop and tried the following approach :-
1.) I exported the db from my desktop (localhost/phpmyadmin).
2.) Copied wordpress/wp-content folder from the desktop version.
3.) Installed xampp and wordpress on my ubuntu os laptop and logged in.
4.) Created db in localhost/phpmyadmin as wordpress and imported the desktop’s version db here.
5.) Selected wordpress as my db while installing wordpress for the first time, everything worked.
6.) Now when I copied and replaced the wp-content folder and go to localhost/wordpress, my site appears (the one which I was working on my desktop (locally)), woohoo.
7.) But when I go to localhost/wordpress/wp-admin/ , it throws error :
Fatal error: Uncaught TypeError: ftp_fput(): Argument #1 ($ftp) must be of type resource, null given in /opt/lampp/htdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php:212 Stack trace: #0 /opt/lampp/htdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php(212): ftp_fput(NULL, '/opt/lampp/htdo...', Resource id #934, 2) #1 /opt/lampp/htdocs/wordpress/wp-content/plugins/astra-sites/inc/classes/class-astra-sites-importer-log.php(73): WP_Filesystem_FTPext->put_contents('/opt/lampp/htdo...', '') #2 /opt/lampp/htdocs/wordpress/wp-includes/class-wp-hook.php(292): Astra_Sites_Importer_Log->has_file_read_write('') #3 /opt/lampp/htdocs/wordpress/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #4 /opt/lampp/htdocs/wordpress/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #5 /opt/lampp/htdocs/wordpress/wp-admin/admin.php(175): do_action('admin_init') #6 /opt/lampp/htdocs/wordpress/wp-admin/index.php(10): require_once('/opt/lampp/htdo...') #7 {main} thrown in /opt/lampp/htdocs/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php on line 212
There has been a critical error on this website. Please check your site admin email inbox for instructions.
Basically I cannot access the Dashboard.
Please guide me and tell me where did I go wrong, I’m really stuck…
Thanks in advance !
4
Answers
Copy paste WordPress may issued in Critical error.
you can use "All in one wp migration" plugin to transfer wordpress in another computer or online server easily.
Assuming your Laptop install of lampp is working correctly:
Should work fine
From what you describe it seems that you have mostly completed the transfer, but your FTP connection is still down. Refer the docs. You will need to search for usages of ftp_connect in your source-code. Hopefully you will find at least a match, or just a few matches. Now, look at the stack trace of the error or the location in your source-code that the error message refers to and figure out which usage of ftp_connect initiated the connection your ftp_fput tries to use and see what host it tries to connect to. Compare that value with the host your old environment uses at the same place and from here onwards you should have everything you need in order to solve the issue.
I think you could use a plugin to make a backup of your WordPress Installation.
After, you install a new WordPress on the second computer.
You install the same backup plugin, and you restore the file, with the text, the database and the images.