Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6852073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:19:37+00:00 2026-05-27T01:19:37+00:00

Is it possible to rename a database already created in android? On my apps

  • 0

Is it possible to rename a database already created in android?

On my apps update I would like to rename the old database and install a new then compare some values and finally delete the old.

I am doing the creation from an sqlite file in the assets folder. This is why I cannot rename all the tables and insert the new ones.

Clarification:

The old database will contain only one table that I need to compare values from against the new (from the update) database.

Both databases have been copied over from an sqlite file in the assets folder.

Once I have compared a values from the old database to new I will delete the old and use the new in its place with the values I compared.

What i was thinking of doing was rename the old create the new in its place and do everything above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:19:38+00:00Added an answer on May 27, 2026 at 1:19 am

    Lord Flash is right, you should delete the old db and copy the new one…

    Assuming you use a SQLiteOpenHelper, you could use a createDatabaseIfRequired(); method in getReadableDatabase() and getWritableDatabase()

    private boolean checkOldDatabase() {
        Log.d(Constants.LOGTAG, "OperationDbHelper.checkDatabase");
        File f = new File(DB_PATH + OLD_DB_NAME);
        return f.exists();
    }
    
    public void createDatabaseIfRequired() throws IOException, SQLiteException {
        if (!checkOldDatabase()) {
          // do db comparison / delete old db / copy new db
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know is it possible to rename a symlink with python.
Is it possible to rename a cell, like A1 to firstCell in C#.?am using
Is it possible to rename directory in svn repository. Not create new revision in
Is it possible to rename all the tabs in a jQuery UI tab control?
Is it possible to rename a list in Sharepoint 2007 using the web interface?
Is it possible to rename a report section in a crystal reports using the
Is it possible to rename a MySQL table? If so, how?
Is it possible to rename a namespace name in an existing API without breaking
Is it possible to rename file when trying to download it? For example, I
Is it possible to rename/refactor a class file and have it rename the actual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.