private void migrateAccounts(EntryDialog d, QHandle handle) throws IOException  {
        AccountInfo info;
        List newList;
        List oldList;
        boolean rc=false;
        
    	info=UserManager.getAccount(handle);
    	if(info!=null) {
        	// we found a userid
    		if(info.getUserID()==_session.getUserID()) {
    			_log.debug("Error: trying to migrate accounts to same disk");
    			_session
				.send(d.getErrorResponse("You cannot migrate accounts to the disk you are terminating.  Please select a user name from a different disk."));
    		} else {
	    		newList=UserManager.getAccountsforUser(info.getUserID());
	    		oldList=UserManager.getAccountsforUser(_session.getUserID());
	    		if(oldList.size() + newList.size() >5) {
	        		//error, to many accounts
	        		_log.debug("Error, too many accounts to migrate");
	    			_session
					.send(d.getErrorResponse("This disk contains " + oldList.size() + " accounts and '"
							+ handle
							+ "' has already created " + newList.size() + " accounts, which would exceed the user name maximum (5).  Please delete user names from one or both disks and try again."));
	        	} else {
	        		// migrate the accounts.
	        		_log.debug("Migrating " + oldList.size() + " accounts from '" + _session.getHandle() + " to '" + handle + "'");
	    			try {
	            		for(int i=0,size=oldList.size();i<size;i++) {
							((AccountInfo)oldList.get(i)).setUserID(info.getUserID());
							((AccountInfo)oldList.get(i)).setRefresh(true);
							((AccountInfo)oldList.get(i)).setPrimaryInd(false);
	            		}
	            		try {
							UserManager.deleteUser(_session.getUserID());
		        			_session
		    				.send(d.getSuccessResponse(oldList.size() + " user names migrated to user '"
		    						+ handle
		    						+ "' and current account closed.  The system will disconnect in 15 seconds."));
		        			_log.debug("Accounts migrated");
		    				_session.send(new InitDataSend(0,0,0));
		    				_session.send(new FileText("Accounts and user names successfully migrated to '" + handle + "'.  The system will now disconnect.",true));
		        			try {
		    					Thread.sleep(15000);
		    				} catch (InterruptedException e1) {
		    				}
		        			_session.send(new LostConnection());
		        			_session.terminate();
						} catch (Exception e2) {
				        	_log.error("Could not delete user id");
						}
					} catch (AccountUpdateException e) {
			        	_log.error("Could not update existing accounts",e);
					}
			        if(!rc) {
		    			_session
						.send(d.getErrorResponse("An error occurred while migrating the user names.  Please contact customer service."));
		    			_log.debug("Account migration error");
						_session.send(new InitDataSend(0,0,0));
						_session.send(new FileText("Accounts and user name migration was not successful..",true));
			        }
	        	}
    		}
        } else {
    		_log.debug("Error, cannot find user: '" + handle + "'");
			_session
			.send(d.getErrorResponse("We're sorry, but user name '" + handle + "' is not a valid user.  Please select another name."));
        }
	}