I need help with an .sql file because I am basically going crazy.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Smack dat
    So Fucking Banned
    • Jul 2016
    • 4613

    #1

    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
    Confirmed User
    • Oct 2003
    • 5744

    #2
    Perhaps your php install is limited to file uploads that are smaller than the size of your file?
    Blog Posts - Contextual Links - Hardlinks on 600+ Blog Network
    * Handwritten * 180 C Class IPs * Permanent! * Many Niches! * Bulk Discounts! GFYPosts /at/ J2Media.net

    Comment

    • Smack dat
      So Fucking Banned
      • Jul 2016
      • 4613

      #3
      Originally posted by PornDiscounts-V
      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’

      Comment

      • Smack dat
        So Fucking Banned
        • Jul 2016
        • 4613

        #4
        40101 set sql_mode=@old_sql_mode

        Comment

        • Smack dat
          So Fucking Banned
          • Jul 2016
          • 4613

          #5
          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

          Comment

          • Smack dat
            So Fucking Banned
            • Jul 2016
            • 4613

            #6
            Originally posted by Smack dat
            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

            Comment

            • Smack dat
              So Fucking Banned
              • Jul 2016
              • 4613

              #7
              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.

              Comment

              • digitalfantasies
                Confirmed User
                • Sep 2010
                • 2759

                #8
                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

                Comment

                • Smack dat
                  So Fucking Banned
                  • Jul 2016
                  • 4613

                  #9
                  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?

                  Comment

                  • Smack dat
                    So Fucking Banned
                    • Jul 2016
                    • 4613

                    #10
                    Originally posted by digitalfantasies
                    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?

                    Comment

                    • Smack dat
                      So Fucking Banned
                      • Jul 2016
                      • 4613

                      #11
                      Originally posted by digitalfantasies
                      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.

                      Comment

                      • dichotomy
                        Confirmed User
                        • Jun 2003
                        • 135

                        #12
                        Originally posted by Smack dat
                        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!
                        #_
                        https://se.marketing/

                        Comment

                        • k0nr4d
                          Confirmed User
                          • Aug 2006
                          • 9231

                          #13
                          - 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.
                          Mechanical Bunny Media
                          Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

                          Comment

                          • Smack dat
                            So Fucking Banned
                            • Jul 2016
                            • 4613

                            #14
                            Originally posted by k0nr4d
                            - 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.

                            Comment

                            • Smack dat
                              So Fucking Banned
                              • Jul 2016
                              • 4613

                              #15
                              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?

                              Comment

                              • digitalfantasies
                                Confirmed User
                                • Sep 2010
                                • 2759

                                #16
                                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_';

                                Comment

                                • digitalfantasies
                                  Confirmed User
                                  • Sep 2010
                                  • 2759

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

                                  Comment

                                  • digitalfantasies
                                    Confirmed User
                                    • Sep 2010
                                    • 2759

                                    #18
                                    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

                                    Comment

                                    • Smack dat
                                      So Fucking Banned
                                      • Jul 2016
                                      • 4613

                                      #19
                                      Originally posted by digitalfantasies
                                      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.

                                      Comment

                                      • dichotomy
                                        Confirmed User
                                        • Jun 2003
                                        • 135

                                        #20
                                        Ohh, Congrats! Really glad you've got it! Must have been relief! And this makes perfect tutorial for archives.
                                        #_
                                        https://se.marketing/

                                        Comment

                                        • digitalfantasies
                                          Confirmed User
                                          • Sep 2010
                                          • 2759

                                          #21
                                          Originally posted by Smack dat
                                          This turned out to be the problem. All sorted now. Many thanks.
                                          great!

                                          Comment

                                          Working...