[CN - 2012] Cant Restore Database

Results 1 to 7 of 7
  1. #1
    Account Upgraded | Title Enabled! JakeJigsaw is offline
    MemberRank
    Jan 2014 Join Date
    ElderineLocation
    201Posts

    [CN - 2012] Cant Restore Database

    "Specified Cast is Not Valid. (SqlManagerUI)"

    I get that anytime I try to upload my account.bak
    I am using a different account.bak than what i was previous.

    https://forum.ragezone.com/f593/cn-website-1077695/

    trying to use this on because it has the Email columns an all that junk.


  2. #2
    Member xArva is offline
    MemberRank
    Mar 2013 Join Date
    51Posts

    Re: [CN - 2012] Cant Restore Database

    Restore it with 2014.

  3. #3
    Account Upgraded | Title Enabled! JakeJigsaw is offline
    MemberRank
    Jan 2014 Join Date
    ElderineLocation
    201Posts

    Re: [CN - 2012] Cant Restore Database

    Quote Originally Posted by xArva View Post
    Restore it with 2014.


    still cant restore

  4. #4
    Account Upgraded | Title Enabled! aqua512 is offline
    MemberRank
    Nov 2012 Join Date
    574Posts

    Re: [CN - 2012] Cant Restore Database

    Stop trying to rename it. You cannot do that. It is named Account. You must restore is as so.

  5. #5
    əʇılə ɯɐ ı fiestanerd69 is offline
    MemberRank
    Jun 2009 Join Date
    958Posts

    Re: [CN - 2012] Cant Restore Database

    Getting kind of annoying now, so I'm just going to help you. The only difference in that table is the sEmail and nAge column, of which neither you need, so you can:

    a. remove those columns from the PHP registration script.
    b. do what I said before and look at the registration script and recreate the columns, not that you need to anymore since I told you what they are.
    c. use the SQL script I made for you which simply just adds the new columns you need.

    Code:
    ALTER TABLE tUser ADD sEmail nvarchar(90) NULL, nAge tinyint NULL
    d. or just use the SQL script (below) I made you for you which this drops the table and recreates it with the correct columns and data types.

    Code:
    USE [Account_CN]
    GO
    
    ALTER TABLE [dbo].[tUser] DROP CONSTRAINT [FK_tUser_tUserAuth_nAuthID]
    GO
    
    /****** Object:  Table [dbo].[tUser]    Script Date: 20/09/2015 9:54:47 PM ******/
    DROP TABLE [dbo].[tUser]
    GO
    
    /****** Object:  Table [dbo].[tUser]    Script Date: 20/09/2015 9:54:47 PM ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE TABLE [dbo].[tUser](
    	[nUserNo] [int] IDENTITY(1,1) NOT NULL,
    	[sUserID] [nvarchar](30) NOT NULL,
    	[sUserPW] [nvarchar](20) NOT NULL,
    	[sUserName] [nvarchar](10) NOT NULL,
    	[bIsBlock] [bit] NOT NULL CONSTRAINT [DF__tUser__bIsBlock__014935CB]  DEFAULT ((0)),
    	[bIsDelete] [bit] NOT NULL CONSTRAINT [DF__tUser__bIsDelete__023D5A04]  DEFAULT ((0)),
    	[nAuthID] [tinyint] NOT NULL CONSTRAINT [DF__tUser__nAuthID__03317E3D]  DEFAULT ((1)),
    	[sUserIP] [nvarchar](30) NOT NULL,
    	[sEmail] [nvarchar](90) NULL,
    	[nAge] [tinyint] NULL,
    	[dDate] [datetime] NOT NULL CONSTRAINT [DF__tUser__dDate__0425A276]  DEFAULT (getdate()),
     CONSTRAINT [PK_tUser_CL] PRIMARY KEY CLUSTERED 
    (
    	[nUserNo] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    
    GO
    
    ALTER TABLE [dbo].[tUser]  WITH CHECK ADD  CONSTRAINT [FK_tUser_tUserAuth_nAuthID] FOREIGN KEY([nAuthID])
    REFERENCES [dbo].[tUserAuth] ([nAuthID])
    GO
    
    ALTER TABLE [dbo].[tUser] CHECK CONSTRAINT [FK_tUser_tUserAuth_nAuthID]
    GO
    For the record, I restored the database, with a different name and it worked fine. Also you do not need to restore this specific database, as far as I am aware it's exactly the same one as I released just with these extra columns which are used for the registration on the website.

  6. #6
    Account Upgraded | Title Enabled! JakeJigsaw is offline
    MemberRank
    Jan 2014 Join Date
    ElderineLocation
    201Posts

    Re: [CN - 2012] Cant Restore Database

    thank you for your patients and insight.
    I finally got the account.bak to upload after completely re-uploading a new database.

    Now I just have one other question, more or less pertaining to the Site release.
    Is there a ItemMall.bak that coordinates with the site?

    I completley wiped my sql databases, an started from 100% scratch.
    The issue wasnt just that I was only using 2012, but it had traces leading to the previous back up some how.
    Last edited by fiestanerd69; 21-09-15 at 03:08 AM. Reason: Added fix as provided by OP.

  7. #7
    əʇılə ɯɐ ı fiestanerd69 is offline
    MemberRank
    Jun 2009 Join Date
    958Posts

    Re: [CN - 2012] Cant Restore Database

    I don't believe the released site has an item mall, you'd be better off asking @aqua512 though. And seeing as your issue has been solved, I am closing this thread. Please make sure to post how you fixed your issue next time as this could help future users. If you would like to take the time, then please send me a message saying how you fixed it and I'll modify your last post to include the fix, seeing as this thread will be closed and you will no longer be able to reply.



Advertisement