Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 11-13-2015, 05:32 AM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if you also had a db backup then yes. Restore everything to how it was before the upgrade then run a query to correct the ref counts, then upgrade again.
Reply With Quote
  #12  
Old 11-13-2015, 06:39 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by squidsk View Post
if you also had a db backup then yes. Restore everything to how it was before the upgrade then run a query to correct the ref counts, then upgrade again.
You know the query to run the refs counts? or where can I find it?
Reply With Quote
  #13  
Old 11-13-2015, 02:15 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by chikuru View Post
You know the query to run the refs counts? or where can I find it?
[sql]UPDATE filedata
LEFT JOIN (
SELECT filedataid, COUNT(attachmentid) AS actual
FROM attachment
GROUP BY filedataid
) list USING (filedataid)
SET refcount = IFNULL(actual, 0)
WHERE refcount <> IFNULL(actual, 0)[/sql]

You'll need to add the table prefix to the table names if your setup uses them. Also as I noted for this query to work the filedata and attachment tables need to be in their pre-upgraded state. Your other option is to reset to 4.2.2 and wait for the 4.2.4 upgrade which includes the above query in the upgrade process.

The query was posted at http://www.vbulletin.com/forum/forum...17#post4330417
Reply With Quote
  #14  
Old 11-13-2015, 02:20 PM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We already upgraded to vb 4.2.3 a month ago..
We have pre upgrade backup. But too old to restore to live site.

What action would you suggest to perform? Should I restore the backup then run this query and merge the database table/s to the live site? If yes, which table/s?

Thank You!

---
Edit:
I guess we will proceed with Paul's suggestion here:
http://www.vbulletin.com/forum/forum...22#post4330622
Reply With Quote
  #15  
Old 11-13-2015, 03:05 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could just restore the attachment and filedata tables to a temporary db, run the query to fix the filedata. Run insert ignore queries on the live database using the content of the temp db tables as the source to restore the lost filedata and attachment data. Once that's done merge a restored copy of the attachment folder with the live copy of the attachment folder.

Take a backup before attempting any of this.
Reply With Quote
  #16  
Old 03-15-2016, 10:14 PM
r5mjh r5mjh is offline
 
Join Date: Dec 2015
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok looks like this is my problem too as im upgrading to 423 too

so correct me if im wrong i need to run the query in my 371 duplicate first then upgrade to 423?

and is it the query above, dave supplied me another query setting it to 1

help appreciated guys as aways
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10488 seconds
  • Memory Usage 2,209KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete