I am currently trying to have my website moved between servers at my hosting company. But am having a problem because my opencart database is huge.
I have looked at it seems 11gb of data is in the _session table
I was wondering if there is any safe way to empty this table, as I assume its just logs of old logins/user sessions on the site?
Any help would be appreciated. If its safe to just literally drop the data out of the table in Phpmyadmin I will do that, I also wonder if theres any way of stopping this from occurring in the future? thanks for your time.
Best regards
Luke
For myself i will backup the database and then give it shot to see if it works well or start throwing some error.lukehackett85 wrote: ↑Sat Aug 15, 2020 11:16 pmHello all,
I am currently trying to have my website moved between servers at my hosting company. But am having a problem because my opencart database is huge.
I have looked at it seems 11gb of data is in the _session table
I was wondering if there is any safe way to empty this table, as I assume its just logs of old logins/user sessions on the site?
Any help would be appreciated. If its safe to just literally drop the data out of the table in Phpmyadmin I will do that, I also wonder if theres any way of stopping this from occurring in the future? thanks for your time.
Best regards
Luke
Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature
I think thats maybe also why my web hosts cant migrate it to the new server :-/
Try to repair and compress your database first.lukehackett85 wrote: ↑Sat Aug 15, 2020 11:54 pmThanks for reply. I've got quite a problem backing up the DB. It times out because its so big. Have tried a few times in phpmyadmin
I think thats maybe also why my web hosts cant migrate it to the new server :-/
If for some reason you cant do it ask your host to make a backup of your db.
Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
You want to wipe the session table entirely? I won't post the query here, but you can just google mysql TRUNCATE so you clearly understand the usage.lukehackett85 wrote: ↑Sun Aug 16, 2020 3:07 amOK, when I click into session table and hit structure in phpmyadmin I do not see a command to drop all records? should it be somewhere else? Thanks for your hgelp so far
If you don't have a backup then accept the risk, especially on 11GB of data, further if you have poor hosting things can go wrong..
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Normally session records are stored in files and php automatically deletes those after x minutes of session inactivity via the standard php garbage collection.
Default OC decided to store those in the database instead but failed to make their custom garbage collection function properly.
Hence the huge accumulation of records.
So you can delete those records with no impact (on a life site users would lose their session and as such their cart content and need to login again etc).
@OP Since you are not aware what drop means in sql lingo, better stay away from the structure tab in phpmyadmin until you read up on what what does. Stay in the "browse" tab and have a look at: https://www.youtube.com/watch?v=mf9XlVfJmxg
you have 3 option:
1) delete the individual records
2) run query "DELETE FROM tablename;" (for tablename you use the session table name)
3) drop the table but then you have to create the table again.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
In phpMyAdmin it's call Empty (Truncate) Table.lukehackett85 wrote: ↑Sun Aug 16, 2020 3:07 amOK, when I click into session table and hit structure in phpmyadmin I do not see a command to drop all records? should it be somewhere else? Thanks for your hgelp so far
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
MAKE SURE - 100% - WITHOUT ANY DOUBT WHATSOEVER - you are in fact in the correct screen and table
If in any doubt, ask for a developer to do this for you. No one here takes ANY responsibility. The risk is all yours.
Select = Number of rows 100
DO NOT Show All - If we are understanding correctly this will crash ..
Selected = check all
and with selected = Delete
Do this over and over on each page
However I am amazed your service provider can not help you get a back up of your database.
How you have gotten this far without ever backing up your database is incredibly dangerous.
I would again go back to your service provider and ask for them to do a back up - especially in light of reading your questions and I say that in the nicest possible way.
Attachments
Screen-Shot-2020-08-15-at-21.38.29.jpg (47.83 KiB) Viewed 3325 times
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
ADD Creative wrote: ↑Sun Aug 16, 2020 9:10 pmhttps://dev.mysql.com/doc/refman/5.7/en ... table.html
TRUNCATE TABLE empties a table completely.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
https://www.opencart.com/index.php?rout ... n_id=38580
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
grgr wrote: ↑Sun Aug 16, 2020 10:00 pmFound this also....
https://www.opencart.com/index.php?rout ... n_id=38580
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
@straightlight Why not spend your time useful by fixing this bug.TRUNCATE TABLE empties a table completely.
https://dictionary.cambridge.org/dictio ... h/truncate
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
https://www.opencart.com/index.php?rout ... cmod.space
Users browsing this forum: Amazon [Bot], Majestic-12 [Bot], nonnedelectari and 320 guests