GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I need help with an .sql file because I am basically going crazy. (https://gfy.com/showthread.php?t=1326562)

Smack dat 04-18-2020 08:33 AM

I need help with an .sql file because I am basically going crazy.
 
If anyone can help it would be appreciated.

Basically I used to own a wordpress site back in 2013/2014. I ended up letting the domain expire but I still have the backup and .sql file.

Anyway, I thought I would try and get it back up and running on a new domain.

I installed wordpress on the new domain and I have been trying all day to get this stupid .sql file from 2014 to upload.

I am trying to do it through cPanel/ mySQL but each time there is some error or other.

I then need to Google the error and a fix and try and make the change.

I also tried editing the SQL file directly but I am just getting myself confused. So, please if anyone knows how to get this installed help me out. Please.

PornDiscounts-V 04-18-2020 08:42 AM

Perhaps your php install is limited to file uploads that are smaller than the size of your file?

Smack dat 04-18-2020 08:47 AM

Quote:

Originally Posted by PornDiscounts-V (Post 22651003)
Perhaps your php install is limited to file uploads that are smaller than the size of your file?

No, I don't think it's that. It's about a 35mb file.

I get things like this: ERROR 1231 (42000): Variable ‘time_zone’ can’t be set to the value of ‘NULL’
and
ERROR 1231 (42000): Variable ‘sql_mode’ can’t be set to the value of ‘NULL’

Smack dat 04-18-2020 08:48 AM

40101 set sql_mode=@old_sql_mode

Smack dat 04-18-2020 09:01 AM

I have decided to start again. I will post every step and errors. if anyone knows they can jump in.

So just uploaded the old .Sql file and I get the error:
Code:

--
-- Table structure for table `wp_afflctable_link`
--

DROP TABLE IF EXISTS `wp_afflctable_link`
MySQL said: Documentation

#1046 - No database selected


Smack dat 04-18-2020 09:08 AM

Quote:

Originally Posted by Smack dat (Post 22651018)
I have decided to start again. I will post every step and errors. if anyone knows they can jump in.

So just uploaded the old .Sql file and I get the error:
Code:

--
-- Table structure for table `wp_afflctable_link`
--

DROP TABLE IF EXISTS `wp_afflctable_link`
MySQL said: Documentation

#1046 - No database selected


Added
Code:

USE database_name;
before the first CREATE TABLE

Smack dat 04-18-2020 09:20 AM

For some reason this time I have a success message: Import has been successfully finished, 493 queries executed.

However, I can't see the posts.

digitalfantasies 04-18-2020 09:27 AM

Did you install WordPress first and then tried to import the sql in existing database?

It's better to create database first and then upload WordPress, it will make necessary databse upgrades.

Also could be that custom posts taxonomy were used if you don't see the posts in your wordpress dashboard

Smack dat 04-18-2020 09:41 AM

Ok, so in mySQL they were on page 2. I can now see the imported posts however they are not visible on the website frontend or backend.

The SQL database now has two post entries:
1. swxl76ygp2d_posts (the newly created posts)
2. wp_posts (my original old posts..

There are loads of these swxl76ygp2d which I presume replaces the original entries. Can I delete them?

Smack dat 04-18-2020 09:44 AM

Quote:

Originally Posted by digitalfantasies (Post 22651053)
Did you install WordPress first and then tried to import the sql in existing database?

It's better to create database first and then upload WordPress, it will make necessary databse upgrades.

Also could be that custom posts taxonomy were used if you don't see the posts in your wordpress dashboard

Yes, I uploaded Wordpress first. It looks like the original install has taken the place of my old DB.

i have the old .sql file. If I delete the wordpress install. How would I get it to use a specific sql file rather than generating it's own?

Smack dat 04-18-2020 09:46 AM

Quote:

Originally Posted by digitalfantasies (Post 22651053)
Did you install WordPress first and then tried to import the sql in existing database?

It's better to create database first and then upload WordPress, it will make necessary databse upgrades.

Also could be that custom posts taxonomy were used if you don't see the posts in your wordpress dashboard

I am so out of the loop.

So, create a new database from within Cpanel and then edit the wordpress wp-config file to point to the new DB?

Makes sense.

dichotomy 04-18-2020 10:05 AM

Quote:

Originally Posted by Smack dat (Post 22651067)
I am so out of the loop.

So, create a new database from within Cpanel and then edit the wordpress wp-config file to point to the new DB?

Makes sense.

I usually go via phpmyadmin with this - there are compatibility options for older MySQL imports and some other options that might help and ye, after it's done, you also need a user with rights to mess that database and then edit existing wp-config.php to match newly imported database and created user credentials. I would go so far to guestimate and get approximate old version of WP installed and once you have your "old site", upgrade it.

Make backups!

Worst case - hire someone to do it for you, plenty people who would do it for a fair price.

Hope it helps!

k0nr4d 04-18-2020 12:39 PM

- SSH into the server, edit my.cnf or server.cnf (mysql config file).
- set the following:
sql_mode=
just like that, no value.
- Restart mysqld
- Run the following command
mysql -u USERNAME -p DATABASENAME < file.sql
it will prompt you for password. Enter the password.

Smack dat 04-18-2020 01:50 PM

Quote:

Originally Posted by k0nr4d (Post 22651202)
- SSH into the server, edit my.cnf or server.cnf (mysql config file).
- set the following:
sql_mode=
just like that, no value.
- Restart mysqld
- Run the following command
mysql -u USERNAME -p DATABASENAME < file.sql
it will prompt you for password. Enter the password.

I don't know how to SSH.

Smack dat 04-18-2020 01:54 PM

Ok, so I thought I would sort it this time.

this is what i did.

Created a new database and user. Added user to database. Saved config details.
Went to FTP and edited the config file.
went back to my domain and it started the install. thought it was going to work but no, it's exactly the same. The files show in mySQL but not front or backend on the website.

Even if I did use a custom posts taxonomy surely the posts/ pages would show in wp-admin?

digitalfantasies 04-18-2020 02:40 PM

Are you sure your table prefixes are the same?

Looks like you have prefix wp_afflctable while the standard prefix is wp_

you can change the prefix in your wordpress configuration file in the line

$table_prefix = 'wp_';

digitalfantasies 04-18-2020 02:41 PM

nevermind wp_afflctable seems to be a plugin table, still cant hurt to check if table prefixes match

digitalfantasies 04-18-2020 02:44 PM

what you can try is some plugins like wp migrate db to import the sql and see if you can retrieve the posts that way

Smack dat 04-19-2020 02:55 AM

Quote:

Originally Posted by digitalfantasies (Post 22651274)
Are you sure your table prefixes are the same?

Looks like you have prefix wp_afflctable while the standard prefix is wp_

you can change the prefix in your wordpress configuration file in the line

$table_prefix = 'wp_';

This turned out to be the problem. All sorted now. Many thanks.

dichotomy 04-19-2020 03:46 AM

Ohh, Congrats! Really glad you've got it! Must have been relief! And this makes perfect tutorial for archives.

digitalfantasies 04-19-2020 07:40 AM

Quote:

Originally Posted by Smack dat (Post 22651483)
This turned out to be the problem. All sorted now. Many thanks.

great! :thumbsup


All times are GMT -7. The time now is 04:11 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc