Wiki

Case Status
Log In

Wiki

 
Database & File Clean-up
  • RSS Feed

Last modified on 1/17/2012 7:55 PM by User.

Tags:

Database & File Clean-up

As an example of some of the tables that can immediately be removed, based on them not having any content and by using the "find" command line utility to see if they are referenced in any script files;

What is 'ysa_options' table for? Is this something Sapple has added?

se_subnets
se_systememails
se_usersettings
se_plugins
se_pmconvoops
se_pmconvos
se_pms
 
se_events
se_eventstyles
se_eventvalues
se_friendexplains           
se_eventfields
se_eventmedia
se_eventmediatags
se_eventcomments
users                                    
user_profiles                    
user_autologin                
se_eventmediacomments
se_eventmembers
se_eventcats
se_eventalbums
 
As a quick way to see if a specific table is referenced in the script files, for example 'se_friendexplains', I ran the following from the SSH command line;
 
[root@p2218905 ~]# find /var/www/html/staging.ysacentral.com/ -size -100M -type f -exec grep -l 'se_friendexplains' {} \;
 
Results:
/var/www/html/staging.ysacentral.com/social_engine/class_user.php
/var/www/html/staging.ysacentral.com/social_engine/include/class_user.php
/var/www/html/staging.ysacentral.com/social_engine/include/class_user4.php
/var/www/html/staging.ysacentral.com/social_engine/include/class_user1.php
/var/www/html/staging.ysacentral.com/social_engine/include/1/class_user.php
/var/www/html/staging.ysacentral.com/social_engine/user_friends_manage.php
/var/www/html/staging.ysacentral.com/admin1/ysa.sql
/var/www/html/staging.ysacentral.com/admin1/schema/ysa.sql
/var/www/html/staging.ysacentral.com/admin1/purelog_ysa.sql
/var/www/html/staging.ysacentral.com/admin/ysa.sql
/var/www/html/staging.ysacentral.com/admin/schema/ysa.sql
/var/www/html/staging.ysacentral.com/admin/purelog_ysa.sql
/var/www/html/staging.ysacentral.com/signup/data/purelog_ysa.sql
 

2012-01-17 by Spencer: Great Example of Multiple, Unnecessary Backups that MUST BE CLEANED UP!
 
I'm not sure that I have made it clear, but in the past when I asked your team to clean-up the files and database, I was referring to issues like I will demonstrate below. I was trying to find the "Bishopric Sign-up Confirmation" email content, so I searched the file system for "Dear Brethren", as you see there are only 2 files where this appears, but 6 different project folders which are just backups of the real content. I know I get confused with all of these backups, so I can only imagine your developers are even more confused. In this example I can guarantee the following main project directories and all thier sub-directories can be deleted... ysa_project4ysa_project_backup_16Augustysa_project5ysa_project_old2, and ysa_project_old. The only main project folder out of these that is for the current project is 'ysa_project' from my understanding. I would of course ask that your team double check my assumptions. These same directories are probably replicated on the staging and live websites as well. Please clean-up the easily identifiable directory, file and database issues. We can then work on the more difficult ones as we have time. 
 
# find /var/www/html/dev.ysacentral.com -type f -exec grep -l 'Dear Brethren' {} \;
 
/var/www/html/dev.ysacentral.com/ysa_project4/system/application/views/bishop/step_3b.php
/var/www/html/dev.ysacentral.com/ysa_project4/system/application/controllers/bishop.php
/var/www/html/dev.ysacentral.com/ysa_project_backup_16August/system/application/views/bishop/step_3b.php
/var/www/html/dev.ysacentral.com/ysa_project_backup_16August/system/application/controllers/bishop.php
/var/www/html/dev.ysacentral.com/ysa_project/system/application/views/bishop/step_3b.php
/var/www/html/dev.ysacentral.com/ysa_project/system/application/controllers/bishop.php
/var/www/html/dev.ysacentral.com/ysa_project5/system/application/views/bishop/step_3b.php
/var/www/html/dev.ysacentral.com/ysa_project5/system/application/controllers/bishop.php
/var/www/html/dev.ysacentral.com/ysa_project_old2/system/application/views/bishop/step_3b.php
/var/www/html/dev.ysacentral.com/ysa_project_old2/system/application/controllers/bishop.php
/var/www/html/dev.ysacentral.com/ysa_project_old/system/application/views/bishop/step_3b.php
/var/www/html/dev.ysacentral.com/ysa_project_old/system/application/controllers/bishop.php
 
### END 2012-01-17 NOTE ###
 
 
Also, I'm 98% sure none of the current code is using the scripts in the '/var/www/html/staging.ysacentral.com/social_engine/' directory or it's sub-directories. It wouldn't hurt for your team to review my checks to make sure I'm thinking correctly.
 
[root@p2218905 ~]# find /var/www/html/staging.ysacentral.com/ -type f -exec grep -l 'social_engine' {} \;
/var/www/html/staging.ysacentral.com/social_engine/pds/client/PDS/bin-debug/PDS.html
/var/www/html/staging.ysacentral.com/social_engine/pds/client/AMD/bin-debug/AMD.html
/var/www/html/staging.ysacentral.com/social_engine/include/email_config.php
/var/www/html/staging.ysacentral.com/social_engine/include/js/ward_setting.js
/var/www/html/staging.ysacentral.com/social_engine/config.inc.php
/var/www/html/staging.ysacentral.com/social_engine/youngstep_two.php
/var/www/html/staging.ysacentral.com/social_engine/OpenInviter/config.php
 
As you can see all references to the 'social_engine' directory are within its own directory. I would suggest renaming the 'social_engine' directory temporarily, then we test most systems and then make the determination to delete it after the testing.
 
I also checked the httpd.conf file and didn't find a virtual host pointing to the 'social_engine' directory.
 

Cleanup Database Tables to Remove Excess Test Data

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
DELETE FROM event_event_info WHERE id < '1673';
DELETE FROM event_invitees WHERE id < '1673';
DELETE FROM event_locations WHERE id < '1673';
DELETE FROM event_rsvp WHERE id < '1673';
TRUNCATE TABLE event_admins;
TRUNCATE TABLE event_guest_foodlist;
TRUNCATE TABLE event_guest_foodlist_bringing;
TRUNCATE TABLE event_guest_foodlist_cats;
TRUNCATE TABLE event_guest_foodlist_items;
TRUNCATE TABLE event_invitees_reminder;
TRUNCATE TABLE event_note_to_hosts;
TRUNCATE TABLE event_polls;
TRUNCATE TABLE event_poll_options;
TRUNCATE TABLE event_poll_widget_results;
TRUNCATE TABLE event_reported;